|
| 1 | +# Copyright Strata Contributors |
| 2 | +# SPDX-License-Identifier: Apache-2.0 OR MIT |
| 3 | +# |
| 4 | +# Downstream check: builds Strata-Boogie against this PR's Strata-CLI code, so |
| 5 | +# we catch breakage before it lands on main. Advisory only — visible on the PR |
| 6 | +# but does not gate merge. |
| 7 | +# |
| 8 | +# Strata-Boogie is a .NET project, not a Lake package: it does not `require` |
| 9 | +# Strata-CLI in a lakefile. Instead it builds the `strata` binary from |
| 10 | +# Strata-CLI and runs `dotnet test` against it via STRATA_VERIFIER_PATH. So |
| 11 | +# this check mirrors Strata-Boogie's own CI, but builds `strata` from the PR's |
| 12 | +# checked-out Strata-CLI rather than a fresh clone of CLI's main. |
| 13 | +# |
| 14 | +# Triggers mirror the other downstream-checks: non-draft PRs (ready_for_review |
| 15 | +# + synchronize) and the `!downstream-check` comment from a repo collaborator. |
| 16 | + |
| 17 | +name: Downstream check |
| 18 | + |
| 19 | +on: |
| 20 | + pull_request: |
| 21 | + types: [ready_for_review, synchronize] |
| 22 | + issue_comment: |
| 23 | + types: [created] |
| 24 | + |
| 25 | +concurrency: |
| 26 | + group: downstream-${{ github.event.issue.number || github.event.pull_request.number }} |
| 27 | + cancel-in-progress: true |
| 28 | + |
| 29 | +permissions: |
| 30 | + contents: read |
| 31 | + |
| 32 | +jobs: |
| 33 | + gate: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + outputs: |
| 36 | + run: ${{ steps.gate.outputs.run }} |
| 37 | + head_sha: ${{ steps.gate.outputs.head_sha }} |
| 38 | + steps: |
| 39 | + - name: Gate |
| 40 | + id: gate |
| 41 | + uses: strata-org/Strata/.github/actions/downstream-gate@main |
| 42 | + |
| 43 | + downstream: |
| 44 | + needs: gate |
| 45 | + if: needs.gate.outputs.run == 'true' |
| 46 | + runs-on: ubuntu-latest |
| 47 | + name: Strata-Boogie |
| 48 | + steps: |
| 49 | + - name: Check out PR's Strata-CLI |
| 50 | + uses: actions/checkout@v6 |
| 51 | + with: |
| 52 | + ref: ${{ needs.gate.outputs.head_sha }} |
| 53 | + path: StrataCLI |
| 54 | + |
| 55 | + - name: Clone Strata-Boogie |
| 56 | + run: git clone --depth 1 https://github.com/strata-org/Strata-Boogie.git downstream |
| 57 | + |
| 58 | + - name: Install cvc5 |
| 59 | + uses: ./StrataCLI/.github/actions/install-cvc5 |
| 60 | + - name: Setup .NET |
| 61 | + uses: actions/setup-dotnet@v5 |
| 62 | + with: |
| 63 | + dotnet-version: '8.0.x' |
| 64 | + |
| 65 | + - name: Restore lake cache |
| 66 | + uses: actions/cache/restore@v5 |
| 67 | + with: |
| 68 | + path: | |
| 69 | + StrataCLI/.lake |
| 70 | + key: downstream-Boogie-${{ runner.os }}-${{ needs.gate.outputs.head_sha }} |
| 71 | + restore-keys: | |
| 72 | + downstream-Boogie-${{ runner.os }}- |
| 73 | +
|
| 74 | + # Build the `strata` binary from the PR's Strata-CLI — this is the |
| 75 | + # artifact Strata-Boogie's integration tests verify against. |
| 76 | + - name: Build strata binary from PR's Strata-CLI |
| 77 | + uses: leanprover/lean-action@v1 |
| 78 | + with: |
| 79 | + build-args: strata |
| 80 | + test: false |
| 81 | + lake-package-directory: StrataCLI |
| 82 | + use-github-cache: false |
| 83 | + |
| 84 | + - name: Save lake cache |
| 85 | + if: always() |
| 86 | + uses: actions/cache/save@v5 |
| 87 | + with: |
| 88 | + path: | |
| 89 | + StrataCLI/.lake |
| 90 | + key: downstream-Boogie-${{ runner.os }}-${{ needs.gate.outputs.head_sha }} |
| 91 | + |
| 92 | + - name: Restore .NET dependencies |
| 93 | + working-directory: downstream |
| 94 | + run: dotnet restore BoogieToStrata.sln |
| 95 | + |
| 96 | + - name: Build Strata-Boogie |
| 97 | + working-directory: downstream |
| 98 | + run: dotnet build BoogieToStrata.sln --no-restore |
| 99 | + |
| 100 | + - name: Run Strata-Boogie integration tests |
| 101 | + working-directory: downstream |
| 102 | + env: |
| 103 | + # Point Boogie's tests at the strata binary built above. The CLI |
| 104 | + # checkout lives at <workspace>/StrataCLI, sibling to downstream/. |
| 105 | + STRATA_VERIFIER_PATH: ${{ github.workspace }}/StrataCLI/.lake/build/bin/strata |
| 106 | + run: dotnet test IntegrationTests/BoogieToStrata.IntegrationTests.csproj --no-build --verbosity normal |
0 commit comments