forked from scratchfoundation/scratch-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 2.75 KB
/
Copy pathnode.js.yml
File metadata and controls
77 lines (66 loc) · 2.75 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
name: CI
on:
push:
branches: [develop]
pull_request:
workflow_dispatch:
jobs:
build:
name: Lint + build smoke test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
# --ignore-scripts dodges the upstream prepublish.mjs micro:bit-firmware
# download (often times out); --include=dev is required because Vercel /
# CI default NODE_ENV=production strips devDependencies, including
# webpack-cli.
# --legacy-peer-deps tolerates the copy-webpack-plugin@14 / webpack@4
# peer-dep mismatch that the npm audit fix introduced (we're stuck on
# webpack 4 until a real upstream-modernisation pass).
- name: Install
run: npm install --ignore-scripts --include=dev --legacy-peer-deps --no-audit --no-fund
# eslint-config-scratch 9.x requires @babel/eslint-parser but the
# project's package.json still pins the older babel-eslint. Install
# @babel/eslint-parser on the side so test:lint can resolve.
- name: Install ESLint parser missing from package.json
run: npm install --no-save --legacy-peer-deps --no-audit --no-fund @babel/eslint-parser
# The micro:bit firmware-flasher imports a generated file that is not
# produced by --ignore-scripts. Stub it; the flasher path won't function
# but every other code path is unaffected.
- name: Stub micro:bit firmware URL
run: |
mkdir -p src/generated
printf "module.exports = '';\n" > src/generated/microbit-hex-url.cjs
# Informational only — the upstream TurboWarp scratch-gui codebase has
# hundreds of pre-existing lint errors (valid-jsdoc, no-unused-vars,
# react/prop-types, …) that we inherit unchanged. Surfacing the count
# in the CI summary without gating PRs on it.
- name: Lint (informational)
continue-on-error: true
run: npm run test:lint
- name: Build (CI=true to suppress webpack ProgressPlugin output flood)
env:
CI: "true"
NODE_ENV: production
NODE_OPTIONS: "--max-old-space-size=8192"
run: npx webpack --bail
- name: Sanity-check build output
run: |
set -e
test -s build/index.html
test -s build/editor.html
test -s build/player.html
# index.html should load the editor chunk (post-splash-relocation)
grep -q 'js/pentapod/editor\.[a-z0-9]\+\.js' build/index.html || (
echo "index.html does not load the editor chunk"; exit 1
)
- name: Unit tests
run: npm run test:unit