ci: gate fuzztesting on whether source code changed

This commit is contained in:
Andrew Poelstra 2024-03-01 16:06:14 +00:00
parent 09f7fc3cff
commit 2203c02347
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 15 additions and 2 deletions

View File

@ -9,8 +9,20 @@ on:
pull_request: pull_request:
jobs: jobs:
Prepare:
runs-on: ubuntu-latest
outputs:
pr_changed_source: ${{ steps.classify_pr.outputs.pr_changed_source }}
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Determine what files the PR changes.
id: classify_pr
run: contrib/classify-pr.sh ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }}
fuzz: fuzz:
if: ${{ !github.event.act }} needs: Prepare
if: ${{ !github.event.act }} && needs.Prepare.outputs.pr_changed_source == 'true'
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
@ -64,7 +76,8 @@ jobs:
path: executed_${{ matrix.fuzz_target }} path: executed_${{ matrix.fuzz_target }}
verify-execution: verify-execution:
if: ${{ !github.event.act }} needs: Prepare
if: ${{ !github.event.act }} && needs.Prepare.outputs.pr_changed_source == 'true'
needs: fuzz needs: fuzz
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps: