-
Notifications
You must be signed in to change notification settings - Fork 291
45 lines (34 loc) · 1.26 KB
/
build-and-run-tests.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
38
39
40
41
42
43
44
45
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node.
# This workflow will be run whenever a new commit is pushed or when a PR is opened up.
# Guide: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build and Run Tests
on:
# run this for every push (CI)
push:
# also run this for PR
pull_request:
jobs:
build:
runs-on: ubuntu-latest
# run this job for every combination of given matrix variables
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
steps:
# checkout our repo for the current commit
- name: Check out repo
uses: actions/checkout@v3
# setup specified node version
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile # do a clean install of all of our dependencies
# build our library to catch any build errors
- name: Build!
run: yarn run build
# run all of our tests
- name: Test!
run: yarn test