Skip to content

Commit 5acfda7

Browse files
committed
chore: Add build dry-run debug outputs
1 parent e3949e1 commit 5acfda7

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,34 +48,25 @@ jobs:
4848
ghc-version: ${{ matrix.ghc }}
4949
cabal-version: "latest"
5050
cabal-update: true
51-
52-
# TODO: Refine this plan.json configuration
53-
- name: Generate plan.json
51+
- name: Configure the build
5452
run: |
55-
cabal update
56-
cabal build --dry-run --enable-benchmarks --enable-tests all > /dev/null
57-
mkdir -p ${{ github.workspace }}/cache-info
58-
cp dist-newstyle/cache/plan.json ${{ github.workspace }}/cache-info/
59-
echo "Plan JSON Hash: $(sha256sum ${{ github.workspace }}/cache-info/plan.json | cut -d ' ' -f 1)"
53+
cabal configure --enable-tests --disable-documentation
54+
cabal build all --dry-run
55+
pwd
56+
echo ${{ github.workspace }}
57+
find . -type f -name "*plan.json"
58+
cat dist-newstyle/cache/plan.json
6059
61-
# TODO: delete /cache-info/ path ?
6260
- name: Restore cached dependencies
6361
uses: actions/cache/restore@v4
6462
id: cache
6563
env:
6664
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
6765
with:
6866
path: ${{ steps.setup.outputs.cabal-store }}
69-
key: ${{ env.key }}-plan-${{ hashFiles('**/cache-info/plan.json') }}
67+
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
7068
restore-keys: ${{ env.key }}-
7169

72-
# Debug the cache hit/miss
73-
- name: Debug Cache Results
74-
run: |
75-
echo "Cache Hit: ${{ steps.cache.outputs.cache-hit }}"
76-
echo "Cache Primary Key: ${{ steps.cache.outputs.cache-primary-key }}"
77-
echo "Cache Matched Key: ${{ steps.cache.outputs.cache-matched-key }}"
78-
7970
- name: Install dependencies
8071
if: steps.cache.outputs.cache-hit != 'true'
8172
run: cabal build all --only-dependencies
@@ -91,4 +82,3 @@ jobs:
9182
run: cabal test all
9283
env:
9384
ROLLBAR_TOKEN: ${{ secrets.ROLLBAR_TOKEN }}
94-

0 commit comments

Comments
 (0)