-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (37 loc) · 1.24 KB
/
ci_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
46
name: CI Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4 # https://github.com/actions/checkout
with:
# Depth 0 will fetch all commits from all branches
# This is required for cherry diff to checkout the master branch when running on pull requests
fetch-depth: 0
# Checks out the branch that triggered the workflow
# - head_ref is set when the event that triggered the workflow is a pull request
# - ref_name is set when the event that triggered the workflow is a push on master
# Refer to: https://stackoverflow.com/a/71158878/1096110
ref: ${{ github.head_ref || github.ref_name }}
- name: Set up node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install node dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Setup fixtures for tests
run: npm run test:setup
- name: Run tests
run: npm test