-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (35 loc) · 1.08 KB
/
main.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-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
pre-commit-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v4
id: cache-restore
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v4
with:
node-version: '18.17.1'
cache: 'yarn'
- name: Yarn Install
run: yarn install
- uses: actions/cache/save@v4
id: cache-save
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- uses: pre-commit/[email protected]
- name: Tests
run: yarn test
continue-on-error: true # ignore test failures for now