Skip to content

Commit

Permalink
Merge pull request #107 from fimad/fimad-patch-1
Browse files Browse the repository at this point in the history
Better optimized caching in GitHub CI
  • Loading branch information
fimad authored Mar 3, 2024
2 parents 1e8622c + f3b377a commit d162e81
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,20 @@ jobs:
name: Restore cached ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**/*.cabal') }}-version-${{ matrix.stackage-version }}
key: ${{ runner.os }}-stack-global-version-${{ matrix.stackage-version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**/*.cabal') }}
restore-keys: |
${{ runner.os }}-stack-global-version-${{ matrix.stackage-version }}-${{ hashFiles('stack.yaml') }}-
${{ runner.os }}-stack-global-version-${{ matrix.stackage-version }}-
${{ runner.os }}-stack-global-
- uses: actions/cache/restore@v3
name: Restore cached .stack-work
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/*.hs') }}-version-${{ matrix.stackage-version }}
key: ${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**/*.cabal') }}-
${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-${{ hashFiles('stack.yaml') }}-
${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-
${{ runner.os }}-stack-work-
- name: Install dependencies
Expand All @@ -59,16 +64,12 @@ jobs:
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**/*.cabal') }}-version-${{ matrix.stackage-version }}
restore-keys: |
${{ runner.os }}-stack-global-
key: ${{ runner.os }}-stack-global-version-${{ matrix.stackage-version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**/*.cabal') }}
- uses: actions/cache/save@v3
name: Cache .stack-work
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/*.hs') }}-version-${{ matrix.stackage-version }}
restore-keys: |
${{ runner.os }}-stack-work-
key: ${{ runner.os }}-stack-work-version-${{ matrix.stackage-version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/*.hs') }}

- name: Build
run: stack build --resolver ${{ matrix.stackage-version }}
Expand Down

0 comments on commit d162e81

Please sign in to comment.