Skip to content

Commit 0743ca7

Browse files
author
Gaël Deest
authored
Merge pull request #1403 from haskell-servant/ci-fix-followups
Try and improve caching on CI
2 parents 53e943b + a28856a commit 0743ca7

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

.github/workflows/main.yml renamed to .github/workflows/master.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,24 @@ jobs:
3232
ghc-version: ${{ matrix.ghc }}
3333
cabal-version: ${{ matrix.cabal }}
3434

35-
- name: Configure
36-
run: |
37-
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
38-
cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.17'
39-
4035
- name: Freeze
4136
run: |
37+
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
4238
cabal freeze
4339
4440
- uses: actions/[email protected]
45-
name: Cache ~/.cabal/store
41+
name: Cache ~/.cabal/store and dist-newstyle
4642
with:
47-
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
43+
path: |
44+
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
45+
dist-newstyle
4846
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
47+
restore-keys: |
48+
${{ runner.os }}-${{ matrix.ghc }}-
49+
50+
- name: Configure
51+
run: |
52+
cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.17'
4953
5054
- name: Build
5155
run: |
@@ -115,16 +119,17 @@ jobs:
115119
stack test --system-ghc
116120
117121
ghcjs:
118-
name: cabal / ghcjs 8.4
122+
name: ubuntu-18.04 / ghcjs 8.4
119123
runs-on: "ubuntu-18.04"
120124

121125
steps:
122126
- uses: actions/checkout@v2
127+
123128
- name: "Setup PATH"
124129
run: |
125-
echo "PATH=$HOME/.cabal/bin:$PATH" >> $GITHUB_ENV
130+
echo "PATH=$HOME/.cabal/bin:/opt/ghcjs/8.4/bin:$PATH" >> $GITHUB_ENV
126131
127-
- name: Install tools
132+
- name: Install ghcjs and cabal
128133
run: |
129134
sudo add-apt-repository ppa:hvr/ghcjs
130135
sudo apt-get update -y
@@ -135,7 +140,23 @@ jobs:
135140
cp cabal.ghcjs.project cabal.project
136141
cat cabal.project
137142
143+
- name: Cabal update and freeze
144+
run: |
138145
cabal v2-update
146+
cabal v2-freeze
147+
148+
- uses: actions/[email protected]
149+
name: Cache ~/.cabal/store and dist-newstyle
150+
with:
151+
path: |
152+
~/.cabal/store
153+
dist-newstyle
154+
key: ubuntu-18.04-ghcjs8.4-${{ hashFiles('cabal.project.freeze') }}
155+
restore-keys: |
156+
ubuntu-18.04-ghcjs8.4-
157+
158+
- name: Install cabal-plan and hspec-discover
159+
run: |
139160
cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project cabal-plan --constraint='cabal-plan ^>=0.6.0.0' --constraint='cabal-plan +exe'
140161
cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
141162

0 commit comments

Comments
 (0)