Add downstream-check CI and shared composite actions #10593
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: [main] | |
| jobs: | |
| get-branch-name: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get branch name | |
| shell: bash | |
| # The workflow is triggered by pull_request so we use `GITHUB_BASE_REF` | |
| run: echo "branch_name=${GITHUB_BASE_REF}" >> $GITHUB_OUTPUT | |
| id: get_branch_name | |
| outputs: | |
| branch_name: ${{ steps.get_branch_name.outputs.branch_name }} | |
| build_and_test_lean: | |
| name: Build and test Lean | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| toolchain: | |
| - stable | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install cvc5 | |
| uses: ./.github/actions/install-cvc5 | |
| - name: Install z3 | |
| uses: ./.github/actions/install-z3 | |
| - name: Install .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore lake cache | |
| # Only use the caches on PRs because there is a risk of stale results: | |
| # https://github.com/strata-org/Strata/issues/952 | |
| if: github.event_name == 'pull_request' | |
| uses: ./.github/actions/restore-lake-cache | |
| with: | |
| path: | | |
| .lake | |
| - name: Download ion-java jar for Java codegen test | |
| run: wget -q -O StrataTestExtra/Languages/Java/testdata/ion-java-1.11.11.jar https://github.com/amazon-ion/ion-java/releases/download/v1.11.11/ion-java-1.11.11.jar | |
| - name: Build and test Strata | |
| uses: leanprover/lean-action@v1 | |
| with: | |
| use-github-cache: false | |
| test: false | |
| - name: Run tests | |
| run: lake test | |
| - name: Verify generated editor syntax files are up to date | |
| run: | | |
| lake env lean --run editors/GenSyntax.lean all | |
| git diff --exit-code editors/vscode/syntaxes/ editors/emacs/ | |
| - name: Save lake cache | |
| uses: ./.github/actions/save-lake-cache | |
| with: | |
| path: | | |
| .lake | |
| - name: Verify Java testdata is up to date | |
| run: | | |
| StrataTestExtra/Languages/Java/regenerate-testdata.sh | |
| git diff --exit-code StrataTestExtra/Languages/Java/testdata/ | |
| lint_checks: | |
| name: Run lint checks | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| toolchain: | |
| - stable | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check copyright headers | |
| uses: ./.github/actions/check-copyright-headers | |
| - name: Check for trailing whitespace | |
| uses: ./.github/actions/lint-whitespace | |
| - name: Check for import Lean | |
| uses: ./.github/actions/check-lean-import | |
| - name: Check Lean version consistency | |
| run: .github/scripts/check_lean_consistency.sh | |
| - name: Check for new panic! usage | |
| uses: ./.github/actions/check-no-panic | |
| with: | |
| base-ref: "origin/${{ github.base_ref || 'main' }}" | |
| build_doc: | |
| name: Build documentation | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build API documentation package | |
| uses: leanprover/lean-action@v1 | |
| with: | |
| lake-package-directory: 'docs/api' | |
| - name: Restore lake cache | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: | | |
| .lake | |
| docs/verso/.lake | |
| key: docs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('lean-toolchain', 'docs/verso/lean-toolchain') }}-${{ hashFiles('lake-manifest.json', 'docs/verso/lake-manifest.json') }}-${{ hashFiles('**/*.st') }}-${{ github.sha }} | |
| restore-keys: | | |
| docs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('lean-toolchain', 'docs/verso/lean-toolchain') }}-${{ hashFiles('lake-manifest.json', 'docs/verso/lake-manifest.json') }}-${{ hashFiles('**/*.st') }} | |
| - name: Build documentation package | |
| uses: leanprover/lean-action@v1 | |
| with: | |
| build-args: '--wfail' | |
| lake-package-directory: 'docs/verso' | |
| use-github-cache: false | |
| - name: Build documentation | |
| run: ./generate.sh | |
| working-directory: docs/verso | |
| - name: Save lake cache | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: | | |
| .lake | |
| docs/verso/.lake | |
| key: docs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('lean-toolchain', 'docs/verso/lean-toolchain') }}-${{ hashFiles('lake-manifest.json', 'docs/verso/lake-manifest.json') }}-${{ hashFiles('**/*.st') }}-${{ github.sha }} | |
| - name: Check for broken links | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| args: --offline --no-progress --exclude-path '.*/find/.*' docs/verso/_out/ | |
| fail: true | |
| cbmc: | |
| needs: build_and_test_lean | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/cbmc.yml |