Repository navigation
63 lines (54 loc) · 1.98 KB
/
Copy pathtest-editor.yml
File metadata and controls
63 lines (54 loc) · 1.98 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
name: Test editor
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
editor-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Syntax check editor.js
run: node --check Editor/resources/editor.js
- name: Verify editor DOM refs
run: |
node - <<'EOF'
const fs = require("fs");
const html = fs.readFileSync("Editor/resources/index.html", "utf8");
const js = fs.readFileSync("Editor/resources/editor.js", "utf8");
const dynamic = new Set(["lib-empty-save", "btn-focus"]);
const ids = new Set([...html.matchAll(/id="([^"]+)"/g)].map(m => m[1]));
const refs = new Set([...js.matchAll(/getElementById\("([^"]+)"\)/g)].map(m => m[1]));
const missing = [...refs].filter(r => !ids.has(r) && !dynamic.has(r));
if (missing.length) {
console.error("Missing ids: " + missing.join(", "));
process.exit(1);
}
console.log("All " + refs.size + " getElementById refs resolve to index.html");
EOF
- name: Validate Neutralino config
run: |
node -e "JSON.parse(require('fs').readFileSync('Editor/neutralino.config.json','utf8')); console.log('neutralino.config.json OK')"
- name: Install + build Neutralino app
run: |
cd Editor
npm ci --ignore-scripts
npx neu update
npx neu build
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Syntax check Python build tool
run: |
python -m py_compile Editor/build.py
deploy-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate workflow YAML
run: |
python -c "import yaml,glob,os; [yaml.safe_load(open(f)) for f in glob.glob('.github/workflows/*.yml')]; print('workflow YAML OK')"