diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index e61ba10..0836a12 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -11,6 +11,7 @@ jobs: - name: Setup Haskell with Stack uses: haskell-actions/setup@v2 + id: setup with: enable-stack: true stack-version: "latest" @@ -18,7 +19,7 @@ jobs: - name: Cache dependencies uses: actions/cache@v4 with: - path: ~/.stack + path: ${{ steps.setup.outputs.stack-root }} key: pedantic-${{ hashFiles('stack.yaml') }} restore-keys: | pedantic- @@ -45,25 +46,18 @@ jobs: - name: Setup Haskell with Stack uses: haskell-actions/setup@v2 + id: setup with: enable-stack: true stack-version: "latest" - - name: Cache dependencies on Unix-like OS - if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') - uses: actions/cache@v4 - with: - path: ~/.stack - key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }} - - - name: Cache dependencies on Windows - if: startsWith(runner.os, 'Windows') + - name: Cache dependencies uses: actions/cache@v4 with: - path: | - ~\AppData\Roaming\stack - ~\AppData\Local\Programs\stack + path: ${{ steps.setup.outputs.stack-root }} key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }} + restore-keys: | + ${{ runner.os }} - name: Install dependencies run: |