diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index bcc9e58084..144455d26a 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -230,6 +230,8 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} + outputs: + output_new_executions: ${steps.} steps: - uses: actions-rs/toolchain@v1 with: @@ -247,9 +249,28 @@ jobs: - name: Build and run libfuzzer_libpng (Linux) if: runner.os == 'Linux' run: ./scripts/executions-check.sh - - name: Build and run libfuzzer_libpng (macOS) + - name: Build and run libfuzzer_libpng (macOS) if: runner.os == 'macOS' - run: /usr/local/bin/bash -c './scripts/executions-check.sh' + run: /usr/local/bin/bash -c './scripts/executions-check.sh' + - name: Post the execution count in a new PR (linux) + if: runner.os == 'Linux' + uses: wow-actions/auto-comment@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pullRequestOpened: | + On the Linux platform: + the execution count of the new fuzzer is ${{env.linux_new_executions}} + the execution count of the last fuzzer is ${{env.linux_last_executions}} + - name: Post the execution count in a new PR (macOS) + if: runner.os == 'macOS' + uses: wow-actions/auto-comment@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pullRequestOpened: | + On the MacOS platform: + the execution count of the new fuzzer is ${{env.macos_new_executions}} + the execution count of the last fuzzer is ${{env.macos_last_executions}} + nostd-build: runs-on: ubuntu-latest diff --git a/scripts/executions-check.sh b/scripts/executions-check.sh index 2d3df11ee8..76f2b421f0 100755 --- a/scripts/executions-check.sh +++ b/scripts/executions-check.sh @@ -40,17 +40,24 @@ main(){ install_libpng build_libpng - echo "start to run the new fuzzer" + #start to run the new fuzzer new_executions=$(build_run_fuzzer) git_checkout build_libpng - echo "start to run the last fuzzer" + #start to run the last fuzzer last_executions=$(build_run_fuzzer) - echo "the execution count of the new fuzzer is $new_executions" - echo "the execution count of the last fuzzer is $last_executions" + prefix="" + if [ "$(uname)" == "Darwin" ]; then + prefix="macos" + else + prefix="linux" + fi + + echo "${prefix}_new_executions=$new_executions" >> "$GITHUB_ENV" + echo "${prefix}_last_executions=$last_executions" >> "$GITHUB_ENV" } main