CI: run λ-box and Rust outputs #120
Workflow file for this run
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: "CI" | |
| on: | |
| pull_request: | |
| paths: | |
| - 'src/**' | |
| - 'test/**' | |
| - 'agda2lambox.cabal' | |
| - 'cabal.project' | |
| - 'Makefile' | |
| - '.github/workflows/**' | |
| push: | |
| paths: | |
| - 'src/**' | |
| - 'test/**' | |
| - 'agda2lambox.cabal' | |
| - 'cabal.project' | |
| - 'Makefile' | |
| - '.github/workflows/**' | |
| branches: [master] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: ${{ matrix.os }} / GHC ${{ matrix.ghc }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| cabal: [3.12.1] | |
| ghc: [9.10.1] | |
| ocaml: [4.14.2] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up GHC | |
| uses: haskell-actions/setup@v2 | |
| id: setup | |
| with: | |
| ghc-version: ${{ matrix.ghc }} | |
| cabal-version: ${{ matrix.cabal }} | |
| - name: Configure the build | |
| run: | | |
| cabal configure --disable-documentation | |
| cabal build all --dry-run | |
| - name: Restore cached dependencies | |
| uses: actions/cache/restore@v4 | |
| id: cache | |
| env: | |
| key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }} | |
| with: | |
| path: ${{ steps.setup.outputs.cabal-store }} | |
| key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
| restore-keys: ${{ env.key }}- | |
| - name: Install dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: cabal build all --only-dependencies | |
| - name: Save cached dependencies | |
| uses: actions/cache/save@v4 | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| with: | |
| path: ${{ steps.setup.outputs.cabal-store }} | |
| key: ${{ steps.cache.outputs.cache-primary-key }} | |
| - name: Build | |
| run: make build | |
| - name: Test | |
| run: make test | |
| - name: Checkout Peregrine | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: peregrine-project/peregrine-tool | |
| ref: 6e3971e07897f17e06cd21c4e20558ea4161861a | |
| path: peregrine-tool | |
| - name: Set up OCaml | |
| uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: ${{ matrix.ocaml }} | |
| - name: Install Peregrine | |
| working-directory: peregrine-tool/ | |
| run: | | |
| opam repo add rocq-released https://rocq-prover.org/opam/released | |
| opam install --deps-only -j4 .github/rocq-peregrine.opam.locked | |
| opam install -j4 ./rocq-peregrine.opam | |
| - name: Compile to Peregrine targets | |
| run: eval $(opam env) && make gen | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: 1.85.0 | |
| - name: Run outputs | |
| run: eval $(opam env) && make run | |
| - name: Generate HTML | |
| run: | | |
| sudo apt-get install -y pandoc zsh wabt | |
| eval $(opam env) && make html | |
| - name: Deploy HTML website | |
| if: github.ref == 'refs/heads/master' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: test/html | |