forked from orcasound/orcahome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test CI workflow and caching (orcasound#77)
* Add test CI workflow and caching * Remove cache-hit skip for setup-node * Move re-used code into separate composite actions * Fix errors
- Loading branch information
Showing
4 changed files
with
55 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: 'Build' | ||
description: 'Builds project' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
# Based on https://nextjs.org/docs/messages/no-cache#github-actions | ||
- uses: actions/cache@v2 | ||
id: cache-build | ||
with: | ||
path: | | ||
~/.npm | ||
${{ github.workspace }}/.next/cache | ||
# Generate a new cache whenever packages or source files change. | ||
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | ||
# If source files changed but packages didn't, rebuild from a prior cache. | ||
restore-keys: | | ||
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | ||
- name: Build project | ||
if: steps.cache-build.outputs.cache-hit != 'true' | ||
run: npm run build | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: 'Setup' | ||
description: 'Setup node and dependencies' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Setup node | ||
id: setup-node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters