diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07eaabc9..5a503f37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,11 +27,32 @@ jobs: - run: nix build -L .#aeneas - run: nix build -L .#checks.x86_64-linux.default + diff_lean_files: + runs-on: [self-hosted, linux, nix] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # deep clone in order to get access to other commits + - id: skip_check + run: | + # Compares this version with `main`, and checks whether the lean files changed. + if git diff origin/main --quiet -- tests/lean && git diff origin/main --quiet -- backends/lean; then + echo 'lean files were not changed in this PR.' + echo "SHOULD_SKIP=0" >> "$GITHUB_ENV" + else + echo 'lean files were changed in this PR.' + echo "SHOULD_SKIP=1" >> "$GITHUB_ENV" + fi + outputs: + should_skip: ${{ env.SHOULD_SKIP }} + lean: + needs: [diff_lean_files] runs-on: [self-hosted, linux, nix] + if: needs.diff_lean_files.outputs.should_skip != 'true' steps: - # Lean cannot run its tests in the sandbox because `elan` will download things - uses: actions/checkout@v4 + # Lean cannot run its tests in the nix sandbox because `elan` will download things - run: nix develop --command bash -c "cd tests/lean && make" charon-pin-is-forward: