-
Notifications
You must be signed in to change notification settings - Fork 4
223 lines (190 loc) · 7.01 KB
/
Copy pathtest.yml
File metadata and controls
223 lines (190 loc) · 7.01 KB
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: ci
on:
pull_request:
branches:
- master
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v7
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependency
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun install --frozen-lockfile
- name: Run lint and typecheck
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run lint
test:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v7
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependency
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun install --frozen-lockfile
- name: Run unit tests with coverage
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run test:coverage
- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: coverage
path: coverage
if-no-files-found: error
node18-smoke:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- name: Install Dependency
run: bun install --frozen-lockfile
- name: Build package
run: bun run build
# Node 18 goes on PATH only after the build: typescript >= 7 ships an
# extensionless ESM bin/tsc that Node 18.17 cannot load.
- name: Set up the oldest supported Node.js
uses: actions/setup-node@v7
with:
node-version: '18.17.0'
- name: Load every built module and run the offline commands
run: node scripts/smoke-lib.js
- name: Check late abort errors on the oldest supported Node.js
run: >-
node tests/fixtures/hermes-async-check.cjs
'{"operation":"abort","modulePath":"./lib/utils/hermes-base.js"}'
- name: Check debug-output failure cleanup on Node 18
env:
HERMES_TEST_NODE: node
run: bun test tests/hermes-blockers.test.ts
publish-dry-run:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v7
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependency
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun install --frozen-lockfile
- name: Prepare dry run publish version
env:
PUBLISH_DRY_RUN: 'true'
PUBLISH_VERSION: 0.0.0-dry-run.${{ github.run_id }}.${{ github.run_attempt }}
run: bun scripts/prepublish.ts
- name: Dry run publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish --dry-run --access public --tag dry-run
hermes-integration:
name: hermes-hbc-${{ matrix.hbc }}${{ matrix.suffix }}
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- hbc: 96
suffix: ""
package: react-native@0.77.3
directory: react-native
executable: sdks/hermesc/linux64-bin/hermesc
- hbc: 98
suffix: ""
package: hermes-compiler@250829098.0.16
directory: hermes-compiler
executable: hermesc/linux64-bin/hermesc
- hbc: 98
suffix: -patch17
package: hermes-compiler@250829098.0.17
directory: hermes-compiler
executable: hermesc/linux64-bin/hermesc
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v7
with:
node-version: '24.x'
- run: bun install --frozen-lockfile
- name: Install the pinned real compiler
shell: bash
env:
COMPILER_PACKAGE: ${{ matrix.package }}
COMPILER_DIRECTORY: ${{ matrix.directory }}
COMPILER_EXECUTABLE: ${{ matrix.executable }}
EXPECTED_HBC: ${{ matrix.hbc }}
run: |
set -euo pipefail
root="$RUNNER_TEMP/hermes-tests/$COMPILER_DIRECTORY"
mkdir -p "$root"
archive=$(npm pack "$COMPILER_PACKAGE" --pack-destination "$RUNNER_TEMP" --silent)
tar -xzf "$RUNNER_TEMP/$archive" --strip-components=1 -C "$root" \
"package/$COMPILER_EXECUTABLE" package/package.json
export HERMESC="$root/$COMPILER_EXECUTABLE"
test -x "$HERMESC"
"$HERMESC" -version
bun -e 'import {probeHbcVersion} from "./src/utils/hermes-base"; if (probeHbcVersion(process.env.HERMESC) !== Number(process.env.EXPECTED_HBC)) throw new Error("unexpected HBC version");'
echo "HERMESC=$HERMESC" >> "$GITHUB_ENV"
- name: Fetch pinned real Metro fixtures
shell: bash
run: |
set -euo pipefail
root="$RUNNER_TEMP/hermes-metro-fixtures"
mkdir -p "$root"
base="https://raw.githubusercontent.com/sunnylqm/hbc-diff-benchmark/e6a870a1c26c4b64c7860d7e1aa575707d22ad88"
for file in base.jsbundle s3-medium-feature.jsbundle; do
curl --fail --location --retry 2 --max-time 60 "$base/fixtures/$file" -o "$root/$file"
done
curl --fail --location --retry 2 --max-time 60 "$base/LICENSE" -o "$root/LICENSE"
echo "11c8ad8f7e8c7c59ee45582c77d896a35fa646617f3ba0f5b338a425a7c93b7d $root/base.jsbundle" | sha256sum --check
echo "a693e68254b6c13fae8f839d20c14f9d11c5ab98d4be1b8d13ba1e929a12d752 $root/s3-medium-feature.jsbundle" | sha256sum --check
echo "HERMES_METRO_FIXTURES=$root" >> "$GITHUB_ENV"
- name: Run real compiler and fallback regressions
run: bun test tests/hermes-*.test.ts
- name: Run seeded differential fuzzing
run: bun run fuzz:hermes-base --rounds 50 --seed ${{ matrix.hbc }} --out "${{ runner.temp }}/hermes-fuzz"
- name: Preserve failing fuzz cases
if: failure()
uses: actions/upload-artifact@v7
with:
name: hermes-fuzz-hbc-${{ matrix.hbc }}${{ matrix.suffix }}
path: ${{ runner.temp }}/hermes-fuzz
if-no-files-found: ignore