Skip to content

Commit

Permalink
Added caching
Browse files Browse the repository at this point in the history
  • Loading branch information
stuart-bradley committed Feb 19, 2024
1 parent 9762608 commit 47e37ff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,15 @@ jobs:
- name: Build
run: npm run build --if-present

- name: Cache
uses: actions/cache@v3
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Run Cypress Tests
run: npm run cypress:ci
18 changes: 14 additions & 4 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copied from https://github.com/marketplace/actions/lint-action
# And: https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions

name: Lint and Test

Expand All @@ -23,19 +24,28 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18
cache: "npm"

- name: Install Node.js dependencies
run: npm ci

- name: Build
run: npm run build --if-present

- name: Cache
uses: actions/cache@v3
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Lint
uses: wearerequired/lint-action@v2
with:
eslint: true
prettier: true

- name: Build
run: npm run build --if-present

- name: Test
run: npm test

0 comments on commit 47e37ff

Please sign in to comment.