mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
81 lines
2.6 KiB
YAML
81 lines
2.6 KiB
YAML
|
name: libFuzzer
|
||
|
|
||
|
env:
|
||
|
# Force the stdout and stderr streams to be unbuffered
|
||
|
PYTHONUNBUFFERED: 1
|
||
|
|
||
|
on: # yamllint disable-line rule:truthy
|
||
|
# schedule:
|
||
|
# - cron: '0 0 2 31 1' # never for now
|
||
|
workflow_dispatch:
|
||
|
jobs:
|
||
|
BuilderFuzzers:
|
||
|
runs-on: [self-hosted, builder]
|
||
|
steps:
|
||
|
- name: Set envs
|
||
|
run: |
|
||
|
cat >> "$GITHUB_ENV" << 'EOF'
|
||
|
TEMP_PATH=${{runner.temp}}/build_check
|
||
|
IMAGES_PATH=${{runner.temp}}/images_path
|
||
|
REPO_COPY=${{runner.temp}}/build_check/ClickHouse
|
||
|
CACHES_PATH=${{runner.temp}}/../ccaches
|
||
|
BUILD_NAME=fuzzers
|
||
|
EOF
|
||
|
- name: Check out repository code
|
||
|
uses: ClickHouse/checkout@v1
|
||
|
with:
|
||
|
clear-repository: true
|
||
|
submodules: true
|
||
|
- name: Build
|
||
|
run: |
|
||
|
sudo rm -fr "$TEMP_PATH"
|
||
|
mkdir -p "$TEMP_PATH"
|
||
|
cp -r "$GITHUB_WORKSPACE" "$TEMP_PATH"
|
||
|
cd "$REPO_COPY/tests/ci" && python3 build_check.py "$BUILD_NAME"
|
||
|
- name: Upload build URLs to artifacts
|
||
|
if: ${{ success() || failure() }}
|
||
|
uses: actions/upload-artifact@v3
|
||
|
with:
|
||
|
name: ${{ env.BUILD_URLS }}
|
||
|
path: ${{ env.TEMP_PATH }}/${{ env.BUILD_URLS }}.json
|
||
|
- name: Cleanup
|
||
|
if: always()
|
||
|
run: |
|
||
|
docker ps --quiet | xargs --no-run-if-empty docker kill ||:
|
||
|
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
|
||
|
sudo rm -fr "$TEMP_PATH" "$CACHES_PATH"
|
||
|
libFuzzerTest:
|
||
|
needs: [BuilderFuzzers]
|
||
|
runs-on: [self-hosted, func-tester]
|
||
|
steps:
|
||
|
- name: Set envs
|
||
|
run: |
|
||
|
cat >> "$GITHUB_ENV" << 'EOF'
|
||
|
TEMP_PATH=${{runner.temp}}/libfuzzer
|
||
|
REPORTS_PATH=${{runner.temp}}/reports_dir
|
||
|
CHECK_NAME=libFuzzer tests
|
||
|
REPO_COPY=${{runner.temp}}/libfuzzer/ClickHouse
|
||
|
KILL_TIMEOUT=10800
|
||
|
EOF
|
||
|
- name: Download json reports
|
||
|
uses: actions/download-artifact@v3
|
||
|
with:
|
||
|
path: ${{ env.REPORTS_PATH }}
|
||
|
- name: Check out repository code
|
||
|
uses: ClickHouse/checkout@v1
|
||
|
with:
|
||
|
clear-repository: true
|
||
|
- name: libFuzzer test
|
||
|
run: |
|
||
|
sudo rm -fr "$TEMP_PATH"
|
||
|
mkdir -p "$TEMP_PATH"
|
||
|
cp -r "$GITHUB_WORKSPACE" "$TEMP_PATH"
|
||
|
cd "$REPO_COPY/tests/ci"
|
||
|
python3 libfuzzer_test_check.py "$CHECK_NAME" "$KILL_TIMEOUT"
|
||
|
- name: Cleanup
|
||
|
if: always()
|
||
|
run: |
|
||
|
docker ps --quiet | xargs --no-run-if-empty docker kill ||:
|
||
|
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
|
||
|
sudo rm -fr "$TEMP_PATH"
|