ClickHouse/.github/actions/common_setup/action.yml
Azat Khuzhin 64a308013f Tune mmap_rnd_bits to workaround sanitizers issues
v1: vm.mmap_rnd_bits=28
v2: rebase with clang 18.1.6 + kernel.randomize_va_space=0
v3: leave only vm.mmap_rnd_bits=28 + use pre-run.sh (hope that it will
    be used), that way docker will not require --privileged and by some
    reason this breaks ASAN (though I cannot reproduce it)
v4: use actions/common_setup over init_runner.sh (it requires some
    manual deploy)
2024-05-19 22:37:16 +02:00

38 lines
1.2 KiB
YAML

name: Common setup
description: Setup necessary environments
inputs:
job_type:
description: the name to use in the TEMP_PATH and REPO_COPY
default: common
type: string
nested_job:
description: the fuse for unintended use inside of the reusable callable jobs
default: true
type: boolean
runs:
using: "composite"
steps:
- name: Setup and check ENV
shell: bash
run: |
echo "Setup the common ENV variables"
cat >> "$GITHUB_ENV" << 'EOF'
TEMP_PATH=${{runner.temp}}/${{inputs.job_type}}
EOF
if [ -z "${{env.GITHUB_JOB_OVERRIDDEN}}" ] && [ "true" == "${{inputs.nested_job}}" ]; then
echo "The GITHUB_JOB_OVERRIDDEN ENV is unset, and must be set for the nested jobs"
exit 1
fi
- name: Setup $TEMP_PATH
shell: bash
run: |
# to remove every leftovers
sudo rm -fr "$TEMP_PATH" && mkdir -p "$TEMP_PATH"
- name: Tune vm.mmap_rnd_bits for sanitizers
shell: bash
run: |
sudo sysctl vm.mmap_rnd_bits
# https://github.com/google/sanitizers/issues/856
echo "Tune vm.mmap_rnd_bits for sanitizers"
sudo sysctl vm.mmap_rnd_bits=28