Skip to content

Commit

Permalink
Update haskell caching for ci and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
timbod7 committed Apr 24, 2023
1 parent 632701a commit 7c69905
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,21 @@ jobs:
- name: Clone project
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v1
- name: Cache ~/.stack
uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-${{ hashFiles('haskell/stack.yaml') }}
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
restore-keys: |
${{ runner.os }}-
${{ runner.os }}-stack-global-
- name: Cache .stack-work
uses: actions/cache@v3
with:
path: haskell/.stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
${{ runner.os }}-stack-work-
- name: Build and run tests
run: "cd haskell; stack build --fast adl-compiler; stack test --fast --no-terminal adl-compiler"
18 changes: 13 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-latest, macos-latest]

steps:
- name: Setup Stack
Expand All @@ -27,13 +27,21 @@ jobs:
- run: |
git fetch --prune --unshallow
- name: Cache dependencies
uses: actions/cache@v1
- name: Cache ~/.stack
uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-2-${{ hashFiles('haskell/stack.yaml') }}
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
restore-keys: |
${{ runner.os }}-2
${{ runner.os }}-stack-global-
- name: Cache .stack-work
uses: actions/cache@v3
with:
path: haskell/.stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
${{ runner.os }}-stack-work-
- name: Build compiler and generate zip
run: "cd haskell; stack build adl-compiler; ./tools/make-dist.hs"
Expand Down

0 comments on commit 7c69905

Please sign in to comment.