[CI] Bump actions/cache from 3.3.1 to 4.0.0 #80
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
# 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(2021-10-23): All these versions resolve to using the | |
# latest Cabal (>=3.4.0.0); they do *not* use the version | |
# of Cabal that originally shipped with the version of GHC. | |
# NOTE(2022-08-28): the newest release is ghc-9.4.2, but | |
# that's not on ubuntu-latest yet; and if something's not | |
# preinstalled, then haskell/actions/setup will use GHCup | |
# to install it but then (the script below) will also try | |
# to install it via apt-get which will fail. | |
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.4', '9.6.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@v3 | |
- 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 & benchmarks here so that when | |
# we run the tests/benchmarks they don't reconfigure things | |
# and thus cause rebuilding. | |
run: cabal configure --minimize-conflict-set --enable-tests --enable-benchmarks --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: why does bytestring run tests via sdist stuff instead | |
# of just directly? I could imagine it being a sanity check | |
# to ensure everything's included in the sdist tarball; but | |
# if that's the reason then shouldn't the build step above | |
# also be done there? (N.B., bytestring doesn't do the above | |
# step explicitly). | |
# Update(2021-10-23): Until I can figure out why they did it | |
# that way, I'm removing that part of the step in order to | |
# (a) simplify this script, and (b) avoid needing to say the | |
# package's name repeatedly. | |
# TODO(2021-10-23): The sdist-based testing approach also | |
# requires fiddling with the `cabal.project` file, apparently | |
# to deal with issues on Windows. Need we do that? | |
# 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 | |
## BUG: Our benchmarks aren't hooked into cabal yet. | |
#- name: Bench | |
# run: cabal bench --benchmark-option=-l all | |
- name: Haddock | |
run: cabal haddock | |
# BUG (2021-10-23): Are our Tasty tests hooked into cabal enough to run this? | |
# 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/[email protected] | |
# - 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 |