Review comments #57
Workflow file for this run
This file contains 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
on: [push] | |
name: build | |
permissions: | |
contents: read | |
env: | |
# The NAME makes it easier to copy/paste snippets from other CI configs | |
NAME: stubs | |
jobs: | |
doc: | |
runs-on: ubuntu-latest | |
permissions: | |
# Cancel workflow | |
actions: write | |
# Upload docs | |
contents: write | |
steps: | |
- name: Cancel previous run | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- name: Setup mdBook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
mdbook-version: '0.4.35' | |
- name: Build docs | |
run: | | |
cd docs | |
mdbook build | |
- name: Package docs | |
shell: bash | |
run: | | |
tar -cvf doc.tar.gz docs/book/* | |
- name: Upload docs artifact | |
uses: actions/upload-artifact@v3 | |
if: github.repository == 'GaloisInc/${{ env.NAME }}' | |
with: | |
name: "${{ env.NAME }}-docs" | |
path: doc.tar.gz | |
if-no-files-found: error | |
# TODO(#10): Enable this after open-sourcing | |
# - name: Push docs | |
# uses: peaceiris/actions-gh-pages@v3 | |
# if: ${{ github.ref == 'refs/heads/main' }} | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: doc/book | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
cabal: ["3.10.1.0"] | |
ghc: ["9.2.8", "9.4.8", "9.6.3"] | |
name: GHC ${{ matrix.ghc }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
- run: cp cabal.project.dist cabal.project | |
- name: Configure the build | |
# generates dist-newstyle/cache/plan.json for the cache key | |
run: cabal build --dry-run | |
- name: Restore cached dependencies | |
uses: actions/cache/restore@v3 | |
id: cache | |
env: | |
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.key }}- | |
- run: cabal build | |
- name: Cache dependencies | |
uses: actions/cache/save@v3 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} |