diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07eaabc9..edbfb51e 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 "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: diff --git a/flake.lock b/flake.lock index 8f4bd0ae..19869f91 100644 --- a/flake.lock +++ b/flake.lock @@ -55,21 +55,6 @@ "type": "github" } }, - "flake-compat_2": { - "locked": { - "lastModified": 1688025799, - "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", - "owner": "nix-community", - "repo": "flake-compat", - "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -173,7 +158,6 @@ "root": { "inputs": { "charon": "charon", - "flake-compat": "flake-compat_2", "flake-utils": [ "charon", "flake-utils"