Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip lean CI if the lean files did not change #386

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
16 changes: 0 additions & 16 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.