1
1
# 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).
5
6
#
6
7
# 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
8
9
# file manually.
9
10
name : ci
10
11
on :
@@ -24,14 +25,19 @@ jobs:
24
25
strategy :
25
26
fail-fast : true
26
27
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.
27
31
os : [ubuntu-latest]
28
- # Note(2021.10.16): GitHub now has 9.0.1.
29
32
ghc : ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.3', '9.0.1']
30
33
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).
31
37
- os : windows-latest
32
- ghc : ' latest' # Lacking Win-specific bits, latest should suffice.
38
+ ghc : ' latest'
33
39
- os : macOS-latest
34
- ghc : ' latest' # Lacking Mac-specific bits, latest should suffice.
40
+ ghc : ' latest'
35
41
steps :
36
42
37
43
-
uses :
haskell/actions/[email protected]
@@ -40,48 +46,53 @@ jobs:
40
46
ghc-version : ${{ matrix.ghc }}
41
47
- name : Update cabal package database
42
48
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
43
58
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).
45
64
with :
46
65
path : |
47
66
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
48
67
dist-newstyle
49
- key : ${{ runner.os }}-${{ matrix.ghc }}
68
+ key : ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
50
69
- name : Install dependencies
51
- run : |
52
- cabal build all --only-dependencies
70
+ run : cabal build all --only-dependencies
53
71
- 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!
58
74
# - 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!
66
77
# - name: Bench
67
- # run: |
68
- # cd unification-fd-*/
69
- # cabal bench --benchmark-option=-l
78
+ # run: cabal bench --benchmark-option=-l all
70
79
- name : Haddock
71
80
run : cabal haddock
72
81
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
74
85
# build-freebsd:
75
86
# # This job intentionally is using macOS because at the time of
76
87
# # the writing Linux and Windows environments don't have the
77
88
# # necessary virtualization features.
78
89
# # See <https://github.com/vmactions/freebsd-vm#under-the-hood>
79
90
# runs-on: macos-latest
80
91
# steps:
81
- # - uses: actions/checkout@v2
92
+ # - uses: actions/checkout@v2.3.5
82
93
# - name: Test
83
94
# id: build-freebsd
84
- # uses: vmactions/[email protected] .2
95
+ # uses: vmactions/[email protected] .5
85
96
# with:
86
97
# usesh: true
87
98
# mem: 4096
0 commit comments