Skip to content

Commit

Permalink
Skip lean CI if the lean files did not change
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Dec 4, 2024
1 parent 9ce798b commit c1cae44
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "CHECK_LEAN=false" >> "$GITHUB_ENV"
else
echo 'lean files were changed in this PR.'
echo "CHECK_LEAN=true" >> "$GITHUB_ENV"
fi
outputs:
check_lean: ${{ env.CHECK_LEAN }}

lean:
needs: [diff_lean_files]
runs-on: [self-hosted, linux, nix]
if: needs.diff_lean_files.outputs.check_lean == '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:
Expand Down

0 comments on commit c1cae44

Please sign in to comment.