-
Notifications
You must be signed in to change notification settings - Fork 847
36 lines (32 loc) · 976 Bytes
/
build.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
name: Build
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read Node version
id: node_version
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Set Node version
uses: actions/setup-node@v2
with:
node-version: '${{ steps.node_version.outputs.NVMRC }}'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.yarn-cache-dir-path.outputs.cache-hit != 'true'
run: yarn
- name: Run build
run: yarn build
- name: Run tests
run: yarn test:ci