Skip to content

[CI] Bump haskell/actions from 2.4.3 to 2.4.7 #69

[CI] Bump haskell/actions from 2.4.3 to 2.4.7

[CI] Bump haskell/actions from 2.4.3 to 2.4.7 #69

Workflow file for this run

# 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.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@v4
- uses: haskell/actions/setup@v2.4.7
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@v2.3.5
# - 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