-
Notifications
You must be signed in to change notification settings - Fork 11
57 lines (54 loc) · 1.23 KB
/
build_and_test.yaml
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
47
48
49
50
51
52
53
54
55
56
57
name: Build and test
on:
push:
branches:
- main
pull_request:
env:
TZ: Europe/London
jobs:
build_and_test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
- name: Install dependencies
run: yarn
- name: Lint code
run: yarn lint
- name: Run prettier list
run: yarn prettier:list
- name: Test code
run: yarn test
- name: Build package
run: yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
test_dist:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build_and_test]
strategy:
matrix:
node: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: yarn
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Test package
run: yarn test:package