Skip to content

Commit

Permalink
chore: add turbo cache for gha
Browse files Browse the repository at this point in the history
Signed-off-by: Vu Nguyen <[email protected]>
  • Loading branch information
vujita committed Jan 7, 2024
1 parent 3fbeb22 commit 27ea1c4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ jobs:
- name: Install deps (with cache)
run: pnpm install --frozen-lockfile

- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Build, lint and type-check
run: pnpm turbo db:generate build lint type-check test
run: pnpm turbo run db:generate build lint type-check test --cache-dir=.turbo

- name: Check workspaces
run: pnpm manypkg check
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,30 @@ jobs:
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies
run: pnpm install
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install deps (with cache)
run: pnpm install --frozen-lockfile

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Run Playwright tests
run: pnpm run test:e2e
run: pnpm turbo run e2e --cache-dir=.turbo

- uses: actions/upload-artifact@v3
if: always()
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"test": {},
"type-check": {
"dependsOn": ["^db:generate", "^build"]
"dependsOn": ["^build"]
}
}
}

0 comments on commit 27ea1c4

Please sign in to comment.