-
Notifications
You must be signed in to change notification settings - Fork 30
92 lines (87 loc) · 2.57 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Test
on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
branches:
jobs:
formatting:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'pnpm'
- run: pnpm install
- run: npx --no-install prettier --cache --verbose --check .
type-checking:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
strategy:
matrix:
node-version: [16.x, 18.x]
ts-version: [5.0.x, 5.1.x]
react-version: [18.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }} & Typescript ${{ matrix.ts-version }} & React ${{ matrix.react-version }}
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- run: |
pnpm install
pnpm add -D \
typescript@${{ matrix.ts-version }} \
react@${{ matrix.react-version }} \
react-dom@${{ matrix.react-version }}
- run: npx --no-install tsc --noEmit
test:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
strategy:
matrix:
node-version: [16.x, 18.x]
react-version: [18.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }} & React ${{ matrix.react-version }}
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- run: |
pnpm install
pnpm add -D \
react@${{ matrix.react-version }} \
react-dom@${{ matrix.react-version }} \
react-test-renderer@${{ matrix.react-version }}
- run: pnpm run test
- name: Upload Coverage
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/master'
with:
name: coverage
path: coverage
if-no-files-found: error
retention-days: 1
coverage:
if: github.ref == 'refs/heads/master'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Coverage
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
- uses: codecov/codecov-action@v3