From ee954269799086a2e8dae83a2217e35df8444c14 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski Date: Thu, 27 Jul 2023 20:31:31 +0000 Subject: [PATCH] Run `trustfall_stubgen` tests when the directory has changed. --- .github/workflows/ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a131b56c..45996401 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -179,7 +179,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - persist-credentials: false + persist-credentials: true - name: Install rust uses: dtolnay/rust-toolchain@stable @@ -189,10 +189,17 @@ jobs: - uses: r7kamura/rust-problem-matchers@v1 # Test everything except trustfall_stubgen, - # which is only tested at release time since its tests are a bit long. + # which is only tested if it has changed since its tests are a bit long. - name: cargo test run: cargo test --workspace --all-targets --all-features --exclude trustfall_stubgen + - name: test trustfall_stubgen if it has changed + run: | + git fetch origin main + + # `git diff --quiet` exits non-zero if there are changes + git diff --quiet HEAD origin/main -- ./trustfall_stubgen || (cd trustfall_stubgen/ && cargo test --all-targets --all-features) + rust-fuzz: name: Check fuzz targets runs-on: ubuntu-latest