-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
96 additions
and
49 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,26 @@ | ||
name: Install | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Cache build | ||
uses: actions/[email protected] | ||
id: build-cache | ||
|
||
with: | ||
# Use faster GNU tar for all runners | ||
enableCrossOsArchive: true | ||
|
||
# Restore build cache (unless commit SHA changes) | ||
key: build-${{ runner.os }}-${{ github.sha }} | ||
path: build | ||
|
||
- name: Build | ||
id: build | ||
|
||
# Skip build when we’ve built this SHA before | ||
if: steps.build-cache.outputs.cache-hit != 'true' | ||
shell: bash | ||
|
||
run: npm run build |
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,33 @@ | ||
name: Install dependencies | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Cache dependencies | ||
uses: actions/[email protected] | ||
id: npm-install-cache | ||
|
||
with: | ||
# Use faster GNU tar for all runners | ||
enableCrossOsArchive: true | ||
|
||
# Restore `node_modules` cache (unless packages change) | ||
key: npm-install-${{ runner.os }}-${{ hashFiles('package-lock.json', '**/package.json') }} | ||
path: node_modules | ||
|
||
- name: Setup Node.js | ||
uses: ./.github/workflows/actions/setup-node | ||
id: setup-node | ||
|
||
with: | ||
# Restore global `~/.npm` cache (unless packages change) | ||
use-cache: ${{ steps.npm-install-cache.outputs.cache-hit != 'true' }} | ||
|
||
- name: Install dependencies | ||
id: install-node | ||
|
||
# Skip install when dependencies are cached | ||
if: steps.npm-install-cache.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: npm ci |
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,19 @@ | ||
name: Setup | ||
|
||
inputs: | ||
use-cache: | ||
description: Restore global `~/.npm` cache | ||
default: 'true' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
id: setup-node | ||
|
||
with: | ||
cache: ${{ inputs.use-cache == 'true' && 'npm' || '' }} | ||
node-version-file: .nvmrc |
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 |
---|---|---|
@@ -1,6 +1,14 @@ | ||
name: Check external links | ||
|
||
on: workflow_dispatch | ||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: | ||
- 'feature/**' | ||
- 'v[0-9]' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
check-links: | ||
|
@@ -11,21 +19,11 @@ jobs: | |
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
cache: npm | ||
check-latest: true | ||
node-version-file: .nvmrc | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
uses: ./.github/workflows/actions/install-node | ||
|
||
- name: Restore build | ||
uses: actions/cache/[email protected] | ||
with: | ||
key: build-cache-${{ runner.os }}-${{ github.sha }} | ||
path: build | ||
- name: Build | ||
uses: ./.github/workflows/actions/build | ||
|
||
- name: Check external broken links | ||
id: check-links | ||
|
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 |
---|---|---|
|
@@ -28,30 +28,11 @@ jobs: | |
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Restore build | ||
uses: actions/[email protected] | ||
id: build-cache | ||
|
||
with: | ||
key: build-cache-${{ runner.os }}-${{ github.sha }} | ||
path: build | ||
|
||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
if: steps.build-cache.outputs.cache-hit != 'true' | ||
|
||
with: | ||
cache: npm | ||
check-latest: true | ||
node-version-file: .nvmrc | ||
|
||
- name: Install dependencies | ||
if: steps.build-cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
uses: ./.github/workflows/actions/install-node | ||
|
||
- name: Build | ||
if: steps.build-cache.outputs.cache-hit != 'true' | ||
run: npm run build | ||
uses: ./.github/workflows/actions/build | ||
|
||
test: | ||
name: ${{ matrix.task.description }} | ||
|
@@ -91,21 +72,11 @@ jobs: | |
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
cache: npm | ||
check-latest: true | ||
node-version-file: .nvmrc | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
uses: ./.github/workflows/actions/install-node | ||
|
||
- name: Restore build | ||
uses: actions/cache/[email protected] | ||
with: | ||
key: build-cache-${{ runner.os }}-${{ github.sha }} | ||
path: build | ||
- name: Build | ||
uses: ./.github/workflows/actions/build | ||
|
||
- name: Run task | ||
id: task | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
build/ | ||
/build/ | ||
node_modules/ | ||
*.log | ||
.DS_Store | ||
|