[CI] update uses
versions
#83
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. | |
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.4', '9.8.1'] | |
include: | |
# BUG(2021-10-24): Since this package does have Win/Mac-specific | |
# build details, we should probably add more than just the | |
# latest GHC. | |
- os: windows-latest | |
ghc: 'latest' | |
- os: macOS-latest | |
ghc: 'latest' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/setup@v2.6.1 | |
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/cache@v4.0.0 | |
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: Add a test suite! | |
#- name: Test | |
# run: cabal test all -j1 | |
## TODO: Add benchmarks! | |
#- 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/freebsd-vm@v0.1.5 | |
# 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 |