-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (33 loc) · 1.11 KB
/
check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Check Set-Up & Build
on:
push: # Run checks on push to any branch, for early notification of issues
jobs:
check:
runs-on: ubuntu-22.04
steps:
# Checkout
- uses: actions/checkout@v3
# Use Node to install dependencies and build
- uses: actions/setup-node@v3
with:
node-version: 16
# Setup caching of npm directory
# Note: It is not recommended to cache node_modules, as it can break across Node versions and won't work with npm ci
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# Install dependencies and build
- name: Install dependencies and build
run: |
npm ci --legacy-peer-deps
npm run build
env:
CI: false