chore: ignore cabal file #11
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: stack-build | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: lts-${{ matrix.stack.lts }} / ghc-${{ matrix.stack.ghc }} / ${{ matrix.os }} | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu] | |
stack: | |
- lts: 23.28 | |
ghc: 9.8.4 | |
- lts: 22.44 | |
ghc: 9.6.7 | |
- lts: &default-lts 21.25 | |
ghc: &default-ghc 9.4.8 | |
include: | |
- os: windows | |
stack: | |
lts: *default-lts | |
ghc: *default-ghc | |
- os: macos | |
stack: | |
lts: 21.25 | |
ghc: 9.8.4 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Stack LTS ${{ matrix.stack-lts }} | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.stack.ghc }} | |
enable-stack: true | |
stack-setup-ghc: true | |
stack-no-global: true | |
- name: Configure the build | |
run: | | |
echo "with key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}" | |
stack config set resolver lts-${{ matrix.stack.lts }} | |
stack build --dry-run | |
# The last step generates dist-newstyle/cache/plan.json for the cache key. | |
- 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.stack-root }} | |
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.key }}- | |
- name: Install dependencies | |
run: stack build --only-dependencies | |
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail. | |
- name: Save cached dependencies | |
uses: actions/cache/save@v3 | |
# Caches are immutable, trying to save with the same key would error. | |
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.stack-root }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: stack build | |
- name: Run tests | |
run: stack test | |
- name: Check cabal file | |
run: stack check | |
continue-on-error: true | |
- name: Build documentation | |
run: stack haddock | |
... |