-
Notifications
You must be signed in to change notification settings - Fork 12
48 lines (36 loc) · 1.06 KB
/
build-and-test.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
46
name: Build and Test
on: [push]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get Node version
id: get-node-version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.get-node-version.outputs.NODE_VERSION }}
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
~/.cache/yarn
node_modules
key: ${{ steps.get-node-version.outputs.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
env:
YARN_CACHE_FOLDER: ~/.cache/yarn
- name: Run Build
run: yarn build
- name: Run Yarn danger
run: yarn danger ci
- name: Run Tests
run: yarn test