-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
197 lines (188 loc) Β· 6.11 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: Continuous Integration
on:
merge_group:
pull_request:
push:
branches:
- v2
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
# 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@v4
- uses: actions/setup-node@v4
with:
cache: yarn
- run: yarn --frozen-lockfile
- run: yarn flow check
ts-types:
name: TypeScript types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
- run: yarn --frozen-lockfile
- run: yarn build-ts
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: [18, 20]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: ${{ matrix.node }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.os }}
- name: Bump max inotify watches (Linux only)
if: ${{ runner.os == 'Linux' }}
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
- run: yarn --frozen-lockfile
- run: yarn build-native-release
- run: yarn test:unit
- name: Upload @parcel/rust artifacts on Linux with Node v20
if: ${{ runner.os == 'Linux' && matrix.node == 20 }}
uses: actions/upload-artifact@v3
with:
name: Rust Linux Binaries
path: |
packages/core/rust/index.d.ts
packages/core/rust/index.js
packages/core/rust/*.node
integration_tests:
name: Integration tests (${{ matrix.os }}, Node ${{ matrix.node }})
strategy:
matrix:
node: [18, 20]
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@v4
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: ${{ matrix.node }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.os }}
- 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: ${{ runner.os == 'Linux' }}
- run: yarn --frozen-lockfile
- run: yarn build-native-release
- run: yarn build
- run: yarn test:integration-ci
# Deployment steps taken from https://github.com/colinwilson/static-site-to-vercel/blob/master/.github/workflows/deploy-preview.yml
repl_build:
name: Build REPL
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
permissions:
deployments: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: wasm32-unknown-unknown
- name: Install wasm-opt
run: |
curl -L -O https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz
tar -xf binaryen-version_116-x86_64-linux.tar.gz
echo "$PWD/binaryen-version_116/bin" >> $GITHUB_PATH
- uses: Swatinem/rust-cache@v2
with:
key: wasm
- name: Bump max inotify watches
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
- run: yarn --frozen-lockfile
- name: Build native packages
run: yarn build-native-release
- run: yarn build
- run: yarn build-native-wasm
- run: yarn workspace @parcel/repl build
# - name: Upload REPL
# uses: actions/upload-artifact@v3
# with:
# name: REPL
# path: 'packages/dev/repl/dist'
- name: Start Deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
env: Preview
override: false
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
id: vercel-action
with:
vercel-token: ${{ secrets.REPL_VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.REPL_VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.REPL_VERCEL_PROJECT_ID }}
github-comment: false
working-directory: packages/dev/repl
# vercel-args: '--prod'
scope: parcel
alias-domains: |
pr-{{PR_NUMBER}}.repl.parceljs.org
- name: Update Deployment Status
uses: bobheadxi/deployments@v1
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
env: Preview
override: false
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ steps.vercel-action.outputs.preview-url }}