-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
121 lines (113 loc) · 3.56 KB
/
ci.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
on: pull_request
name: Continuous Integration
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v1
# use `--frozen-lockfile` to fail immediately if the committed yarn.lock needs updates
# https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-frozen-lockfile
- run: yarn --frozen-lockfile
- run: yarn lint
flow:
name: Flow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
- run: yarn --frozen-lockfile
- run: yarn flow check
benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- name: PR Benchmarks
uses: parcel-bundler/parcel-benchmark-action@master
env:
PARCEL_BENCHMARK_APIKEY: ${{ secrets.PARCEL_BENCHMARK_APIKEY }}
unit_tests:
name: Unit tests (${{matrix.os}}, Node ${{matrix.node}})
strategy:
matrix:
node: [14, 16]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{matrix.node}}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Bump max inotify watches (Linux only)
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
if: ${{matrix.os == 'ubuntu-latest'}}
- run: yarn --frozen-lockfile
- run: yarn build-native-release
- run: yarn test:unit
integration_tests:
name: Integration tests (${{matrix.os}}, Node ${{matrix.node}})
strategy:
matrix:
node: [14, 16]
os: [ubuntu-latest, macos-latest, windows-latest]
# These tend to be quite flakey, so one failed instance shouldn't stop
# others from potentially succeeding
fail-fast: false
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{matrix.node}}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Bump max inotify watches (Linux only)
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
if: ${{matrix.os == 'ubuntu-latest'}}
- run: yarn --frozen-lockfile
- run: yarn build-native-release
- run: yarn build
- run: yarn test:integration-ci
# Similar to
# https://github.com/marketplace/actions/publish-unit-test-results#use-with-matrix-strategy
- name: Upload JUnit results
if: always()
uses: actions/upload-artifact@v2
with:
name: Integration tests (${{matrix.os}}, node ${{matrix.node}})
path: '**/junit-*.xml'
test_report:
name: Test report
runs-on: ubuntu-latest
needs: [unit_tests, integration_tests]
if: always()
steps:
- name: Create test report
uses: mikepenz/action-junit-report@v2
with:
report_paths: artifacts/**/*.xml