CI: test + generate HTML #81
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: | |
| push: | |
| paths: | |
| - 'src/**' | |
| - 'test/**' | |
| - 'agda2lambox.cabal' | |
| - 'cabal.project' | |
| - 'Makefile' | |
| 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] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up GHC ${{ matrix.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: Generate HTML | |
| run: | | |
| sudo apt-get install -y pandoc zsh | |
| make html | |
| - name: Deploy HTML website | |
| if: github.ref == 'refs/heads/master' | |
| uses: ad-m/github-push-action@v0.6.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: gh-pages | |
| force: true | |
| directory: test/html |