Bump github/codeql-action from 3.26.12 to 3.26.13 (#976) #1096
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
name: Haskell Stack | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
types: [opened, synchronize] | |
permissions: {} | |
jobs: | |
test: | |
name: CI | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false # don't cancel other jobs if one fails | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
# We don't split on multiple resolvers as the ~/.stack grows to ~700MB | |
# whereas all others (including Cabal ones) barely reach 50MB. Instead, | |
# we only use nightly as the resolver, as this should handle the newest | |
# GHC and is also the place where failures will be reported from Stack. | |
resolver: [nightly] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
with: | |
persist-credentials: false | |
- name: Setup Haskell Compiler (stack) | |
id: setup-haskell | |
uses: haskell-actions/setup@dd344bc1cec854a369df8814ce17ef337d6e6170 # v2.7.6 | |
with: | |
enable-stack: true | |
stack-no-global: true | |
- name: Cache .stack-work | |
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0 | |
with: | |
path: .stack-work | |
key: stack-work-${{ matrix.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml', '**/*.cabal') }}-${{ hashFiles('internal/**','src/**','app/**','tests/**','benchmarks/**') }} | |
restore-keys: | | |
stack-work-${{ matrix.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml', '**/*.cabal') }}- | |
stack-work-${{ matrix.os }}-${{ matrix.resolver }}- | |
- name: Cache ~/.stack | |
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0 | |
with: | |
path: ${{ steps.setup-haskell.outputs.stack-root }} | |
key: stack-root-${{ matrix.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml', '**/*.cabal') }} | |
restore-keys: stack-root-${{ matrix.os }}-${{ matrix.resolver }}- | |
# Check this before building, otherwise stack will overwrite the cabal file. | |
- name: Validate cabal file is properly generated from HPack | |
if: matrix.os != 'windows-latest' # Since we're using `diff -u`, cannot run on Windows | |
run: | | |
mv hindent.cabal hindent.cabal.original | |
# See https://github.com/commercialhaskell/stack/issues/3697#issuecomment-353729540. | |
stack build --resolver=${{ matrix.resolver }} --dry-run | |
diff -u hindent.cabal.original hindent.cabal | |
- name: Get dependencies | |
run: stack build --resolver=${{ matrix.resolver }} --only-dependencies --test --bench --no-run-tests --no-run-benchmarks | |
- name: Build code | |
run: stack build --resolver=${{ matrix.resolver }} --test --bench --no-run-tests --no-run-benchmarks | |
- name: Test code | |
run: stack test --resolver=${{ matrix.resolver }} | |
- name: Benchmark code | |
run: stack bench --resolver=${{ matrix.resolver }} | |
- name: Generate documentation | |
run: stack haddock --resolver=${{ matrix.resolver }} |