forked from annthurium/affirmations
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1023 Bytes
/
nodejs.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
# This workflow will do a clean install of node dependencies and run tests on node version 14.x
name: Affirmations CI
run-name: ${{ github.actor }} is running Affirmations CI on branch ${{ github.ref_name }}
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "14.x"
- name: Caching node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ github.ref }}
${{ runner.os }}-node-
- name: Installing dependencies
run: |
if [ -f yarn.lock ]; then
yarn install
else
npm install
fi
- name: Building application
run: npm run build --if-present
- name: Running tests
run: npm test
env:
CI: true