Skip to content

Commit db21f13

Browse files
authored
Merge pull request #174 from LKedward/ci-caching
Cache Haskell stack build in CI
2 parents 3a698ba + e754281 commit db21f13

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/CI.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ jobs:
1919
matrix:
2020
os: [ubuntu-latest, macos-latest, windows-latest]
2121
gcc_v: [9] # Version of GFortran we want to use.
22+
include:
23+
- os: ubuntu-latest
24+
STACK_CACHE: "/home/runner/.stack/"
25+
STACK_CACHE_VERSION: ""
26+
- os: macos-latest
27+
STACK_CACHE: |
28+
/Users/runner/.stack/snapshots
29+
/Users/runner/.stack/setup-exe-src
30+
STACK_CACHE_VERSION: "v2"
31+
- os: windows-latest
32+
STACK_CACHE: |
33+
C:\Users\runneradmin\AppData\Roaming\stack
34+
C:\Users\runneradmin\AppData\Local\Programs\stack
35+
STACK_CACHE_VERSION: "v2"
36+
2237
env:
2338
FC: gfortran
2439
GCC_V: ${{ matrix.gcc_v }}
@@ -61,6 +76,19 @@ jobs:
6176
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
6277
--slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V}
6378
79+
- name: Get Time
80+
id: time
81+
uses: nanzm/[email protected]
82+
with:
83+
format: 'YYYY-MM'
84+
85+
- name: Setup github actions cache
86+
id: cache
87+
uses: actions/cache@v2
88+
with:
89+
path: ${{matrix.STACK_CACHE}}
90+
key: ${{ runner.os }}-${{ steps.time.outputs.time }}${{matrix.STACK_CACHE_VERSION}}
91+
6492
- name: Build Haskell fpm
6593
run: |
6694
cd bootstrap

0 commit comments

Comments
 (0)