[CI] Bump actions/cache from 4.0.2 to 4.1.2 #145
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
# This GitHub Actions script was modified from from: | |
# <https://github.com/haskell/bytestring/blob/master/.github/workflows/ci.yml> | |
# (commit/bd3c32c784bde80c9a46b22ef0029e668c954e70) 2021-10-09 | |
# with particular changes taken from <https://kodimensional.dev/github-actions> | |
# (which has still more stuff we may want to incorporate later). | |
# | |
# Once Haskell-CI fully supports generating GitHub Actions scripts, | |
# we should switch over to using that rather than maintaining this | |
# file manually. | |
name: ci | |
on: | |
push: | |
branches: | |
- master | |
pull_request: {} | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
# Note: All these versions resolve to using the latest Cabal | |
# (3.6.2.0 as of 2021-12-14); they do *not* use the version | |
# of Cabal that originally shipped with the version of GHC. | |
# Which is good, because we require Cabal>=2.2 which only | |
# ships with GHC>=8.4 | |
os: [ubuntu-latest] | |
ghc: ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.3', '9.0.1', '9.2.4', '9.4.8', '9.6.5', '9.8.2', '9.10.1'] | |
include: | |
# This package has no build details specific to Win/Mac, | |
# so building for the latest GHC should be sufficient | |
# (in conjunction with the full list above for Ubuntu). | |
- os: windows-latest | |
ghc: 'latest' | |
- os: macOS-latest | |
ghc: 'latest' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/[email protected] | |
id: setup-haskell-cabal | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
- name: Update cabal package database | |
run: cabal update | |
- name: Configure | |
# Generates the `cabal.project.local` file. | |
# | |
# We make sure to enable tests (and benchmarks) here so that | |
# when we run the tests/benchmarks they don't reconfigure | |
# things and thus cause rebuilding. However, since criterion | |
# has a huge number of dependencies, we're disabling benchmarks | |
# for now; since there's no need to run them on every commit. | |
run: cabal configure --minimize-conflict-set --enable-tests --test-show-details=direct | |
- name: Freeze | |
# Generates the `cabal.project.freeze` file. | |
run: cabal freeze | |
- uses: actions/[email protected] | |
name: Cache ~/.cabal/store and ./dist-newstyle | |
# TODO(2021-10-23): Do we really want the hash in the key? | |
# With nix-style builds it shouldn't be necessary (afaict), | |
# and so it reduces the likelihood of cache hits (albeit | |
# also reducing the footprint of the cache). | |
with: | |
path: | | |
${{ steps.setup-haskell-cabal.outputs.cabal-store }} | |
dist-newstyle | |
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | |
- name: Install dependencies | |
run: cabal build all --only-dependencies | |
- name: Build | |
run: cabal build all | |
# TODO(2021-10-23): if we run into issues with Windows builds | |
# being flaky, then we should use ByteString's hack of: | |
# ``` | |
# bld() { cabal build .:tests; } | |
# bld || bld || bld | |
# ``` | |
# to try building the tests a few times before admitting failure. | |
# <https://github.com/haskell/actions/issues/36> | |
- name: Test | |
run: cabal test all -j1 | |
# TODO(2021-12-11): Set up a separate GitHub Actions workflow | |
# to run these on demand (instead of running them on every | |
# commit, as they would be here). | |
#- name: Bench | |
# run: cabal bench --benchmark-option=-l all | |
- name: Haddock | |
run: cabal haddock | |
# TODO(2021-10-23): Should probably move to using Cirrus instead, | |
# since that's what bytestring does since: | |
# (commit/06cbef10f4869c6afdac210a22d9813b4f7f2fe6) 2021-06-10 | |
#build-freebsd: | |
# # This job intentionally is using macOS because at the time of | |
# # the writing Linux and Windows environments don't have the | |
# # necessary virtualization features. | |
# # See <https://github.com/vmactions/freebsd-vm#under-the-hood> | |
# runs-on: macos-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Test | |
# id: build-freebsd | |
# uses: vmactions/[email protected] | |
# with: | |
# usesh: true | |
# mem: 4096 | |
# prepare: pkg install -y ghc hs-cabal-install git | |
# # Virtual machine does not allow to leverage cache | |
# # and is quite slow, so only tests are run. | |
# run: | | |
# cabal update | |
# cabal test --test-show-details=direct |