Skip to content

Commit 14cad4f

Browse files
committed
.github/workflows/ci.yml: updating to avoid package-naming bugs
1 parent 1948630 commit 14cad4f

File tree

1 file changed

+39
-28
lines changed

1 file changed

+39
-28
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# This GitHub Actions script was modified from from:
2-
# <https://github.com/haskell/bytestring/blob/master/.github/workflows/ci.yml>
3-
# commit/784cdd7dc492f283f41c28bfee1ab62a20c4d353
4-
# For more guidance, see also <https://kodimensional.dev/github-actions>
2+
# <https://github.com/haskell/bytestring/blob/master/.github/workflows/ci.yml>
3+
# (commit/bd3c32c784bde80c9a46b22ef0029e668c954e70) 2021-10-09
4+
# with particular changes taken from <https://kodimensional.dev/github-actions>
5+
# (which has still more stuff we may want to incorporate later).
56
#
67
# Once Haskell-CI fully supports generating GitHub Actions scripts,
7-
# we should switch over to useing that rather than maintaining this
8+
# we should switch over to using that rather than maintaining this
89
# file manually.
910
name: ci
1011
on:
@@ -24,14 +25,19 @@ jobs:
2425
strategy:
2526
fail-fast: true
2627
matrix:
28+
# Note(2021-10-23): All these versions resolve to using the
29+
# latest Cabal (3.4.0.0); they do *not* use the version of
30+
# Cabal that originally shipped with the version of GHC.
2731
os: [ubuntu-latest]
28-
# Note(2021.10.16): GitHub now has 9.0.1.
2932
ghc: ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.3', '9.0.1']
3033
include:
34+
# This package has no build details sepcific to Win/Mac,
35+
# so building for the latest GHC should be sufficent
36+
# (in conjunction with the full list above for Ubuntu).
3137
- os: windows-latest
32-
ghc: 'latest' # Lacking Win-specific bits, latest should suffice.
38+
ghc: 'latest'
3339
- os: macOS-latest
34-
ghc: 'latest' # Lacking Mac-specific bits, latest should suffice.
40+
ghc: 'latest'
3541
steps:
3642
- uses: actions/[email protected]
3743
- uses: haskell/actions/[email protected]
@@ -40,48 +46,53 @@ jobs:
4046
ghc-version: ${{ matrix.ghc }}
4147
- name: Update cabal package database
4248
run: cabal update
49+
- name: Configure
50+
# Generates the `cabal.project.local` file.
51+
# We make sure to enable tests & benchmarks here so that when
52+
# we run the tests/benchmarks they don't reconfigure things
53+
# and thus cause rebuilding.
54+
run: cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
55+
- name: Freeze
56+
# Generates the `cabal.project.freeze` file.
57+
run: cabal freeze
4358
- uses: actions/[email protected]
44-
name: Cache cabal stuff
59+
name: Cache ~/.cabal/store and ./dist-newstyle
60+
# TODO(2021-10-23): Do we really want the hash in the key?
61+
# With nix-style builds it shouldn't be necessary (afaict),
62+
# and so it reduces the likelihood of cache hits (albeit
63+
# also reducing the footprint of the cache).
4564
with:
4665
path: |
4766
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
4867
dist-newstyle
49-
key: ${{ runner.os }}-${{ matrix.ghc }}
68+
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
5069
- name: Install dependencies
51-
run: |
52-
cabal build all --only-dependencies
70+
run: cabal build all --only-dependencies
5371
- name: Build
54-
run: |
55-
cabal build all
56-
## BUG: our Tasty tests aren't hooked into cabal yet...
57-
## TODO: why does bytestring run tests via sdist stuff instead of just directly?
72+
run: cabal build all
73+
## TODO: Add a test suite!
5874
#- name: Test
59-
# run: |
60-
# cabal sdist -z -o .
61-
# cabal get unification-fd-*.tar.gz
62-
# cd unification-fd-*/
63-
# cp ../cabal.project .
64-
# cabal test --test-show-details=direct
65-
## We have no benchmarks yet
75+
# run: cabal test all -j1
76+
## TODO: Add benchmarks!
6677
#- name: Bench
67-
# run: |
68-
# cd unification-fd-*/
69-
# cabal bench --benchmark-option=-l
78+
# run: cabal bench --benchmark-option=-l all
7079
- name: Haddock
7180
run: cabal haddock
7281

73-
## BUG: our Tasty tests aren't hooked into cabal yet, so no point in this yet
82+
# TODO(2021-10-23): Should probably move to using Cirrus instead,
83+
# since that's what bytestring does since:
84+
# (commit/06cbef10f4869c6afdac210a22d9813b4f7f2fe6) 2021-06-10
7485
#build-freebsd:
7586
# # This job intentionally is using macOS because at the time of
7687
# # the writing Linux and Windows environments don't have the
7788
# # necessary virtualization features.
7889
# # See <https://github.com/vmactions/freebsd-vm#under-the-hood>
7990
# runs-on: macos-latest
8091
# steps:
81-
# - uses: actions/checkout@v2
92+
# - uses: actions/checkout@v2.3.5
8293
# - name: Test
8394
# id: build-freebsd
84-
# uses: vmactions/[email protected].2
95+
# uses: vmactions/[email protected].5
8596
# with:
8697
# usesh: true
8798
# mem: 4096

0 commit comments

Comments
 (0)