on master help sign in
Try and improve caching
d6fb382Gaël Deest
.github/workflows/main.yml+31−10
@@ -32,20 +32,24 @@ jobs:
32 ghc-version: ${{ matrix.ghc }}
32 ghc-version: ${{ matrix.ghc }}
33 cabal-version: ${{ matrix.cabal }}
33 cabal-version: ${{ matrix.cabal }}
34
34
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−
40 - name: Freeze
35 - name: Freeze
41 run: |
36 run: |
37+ cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
42 cabal freeze
38 cabal freeze
43
39
44 - uses: actions/cache@v2.1.3
40 - uses: actions/cache@v2.1.3
45− name: Cache ~/.cabal/store
41+ name: Cache ~/.cabal/store and dist-newstyle
46 with:
42 with:
43+ path: |
47− path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
44+ ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
45+ dist-newstyle
48 key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
46 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'
49
53
50 - name: Build
54 - name: Build
51 run: |
55 run: |
@@ -115,16 +119,17 @@ jobs:
115 stack test --system-ghc
119 stack test --system-ghc
116
120
117 ghcjs:
121 ghcjs:
118− name: cabal / ghcjs 8.4
122+ name: ubuntu-18.04 / ghcjs 8.4
119 runs-on: "ubuntu-18.04"
123 runs-on: "ubuntu-18.04"
120
124
121 steps:
125 steps:
122 - uses: actions/checkout@v2
126 - uses: actions/checkout@v2
127+
123 - name: "Setup PATH"
128 - name: "Setup PATH"
124 run: |
129 run: |
125− echo "PATH=$HOME/.cabal/bin:$PATH" >> $GITHUB_ENV
130+ echo "PATH=$HOME/.cabal/bin:/opt/ghcjs/8.4/bin:$PATH" >> $GITHUB_ENV
126
131
127− - name: Install tools
132+ - name: Install ghcjs and cabal
128 run: |
133 run: |
129 sudo add-apt-repository ppa:hvr/ghcjs
134 sudo add-apt-repository ppa:hvr/ghcjs
130 sudo apt-get update -y
135 sudo apt-get update -y
@@ -135,7 +140,23 @@ jobs:
135 cp cabal.ghcjs.project cabal.project
140 cp cabal.ghcjs.project cabal.project
136 cat cabal.project
141 cat cabal.project
137
142
143+ - name: Cabal update and freeze
144+ run: |
138 cabal v2-update
145 cabal v2-update
146+ cabal v2-freeze
147+
148+ - uses: actions/cache@v2.1.3
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: |
139 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'
160 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'
140 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
161 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
141
162