|
9 | 9 | jobs: |
10 | 10 | fuzz-utils: |
11 | 11 | runs-on: ubuntu-22.04 |
| 12 | + permissions: |
| 13 | + actions: read |
12 | 14 | timeout-minutes: 30 |
13 | 15 | steps: |
14 | 16 | - name: Checkout source code |
|
37 | 39 | run: conan install . --output-folder=build --build=missing -o "celix/*:build_utils=True" -o "celix/*:enable_fuzzing=True" -o "celix/*:enable_address_sanitizer=True" -o "celix/*:enable_undefined_sanitizer=True" |
38 | 40 | - name: Conan build |
39 | 41 | run: conan build . --output-folder=build -o "celix/*:build_utils=True" -o "celix/*:enable_fuzzing=True" -o "celix/*:enable_address_sanitizer=True" -o "celix/*:enable_undefined_sanitizer=True" -o "celix/*:celix_err_buffer_size=5120" |
| 42 | + - name: Restore previous fuzzing corpora artifact |
| 43 | + continue-on-error: true #can fail if no previous fuzzing-corpora-artifact exists |
| 44 | + env: |
| 45 | + GH_TOKEN: ${{ github.token }} |
| 46 | + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} |
| 47 | + run: | |
| 48 | + #retrieve lastest master / Celix Fuzzing run id |
| 49 | + RUN_ID=$(gh run list --branch "${BRANCH_NAME}" --workflow "${{ github.workflow }}" --json databaseId --jq '.[0].databaseId') |
| 50 | + gh run download "$RUN_ID" --name fuzzing-corpora-artifact |
| 51 | + mkdir -p build/libs/utils/fuzzing |
| 52 | + tar -xzf fuzzing-corpora-artifact.tar.gz -C fuzzing-previous |
40 | 53 | - name: Set fuzzer run time |
41 | 54 | id: set-runtime |
42 | 55 | run: | |
|
57 | 70 | run: | |
58 | 71 | source build/conanrun.sh |
59 | 72 | ./build/libs/utils/fuzzing/celix_filter_fuzzer -max_total_time=$FUZZ_TIME ./build/libs/utils/fuzzing/filter_corpus |
| 73 | + - name: Package fuzzing corpora artifacts |
| 74 | + if: always() #Always package & upload updated fuzzing corpora artifacts |
| 75 | + run: | |
| 76 | + mkdir -p fuzzing-artifact |
| 77 | + for path in build/libs/utils/fuzzing/*_corpus; do |
| 78 | + cp -a "$path" fuzzing-artifact/ |
| 79 | + done |
| 80 | + tar -czf fuzzing-corpora-artifact.tar.gz -C fuzzing-artifact . |
| 81 | + - name: Upload fuzzing artifacts |
| 82 | + if: always() #Always package & upload updated fuzzing corpora artifact |
| 83 | + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 #v4.3.1 |
| 84 | + with: |
| 85 | + name: fuzzing-corpora-artifact |
| 86 | + path: fuzzing-corpora-artifact.tar.gz |
0 commit comments