Skip to content

Commit a134930

Browse files
author
Wasim
committed
ci: Add GitHub Actions workflow for static checks
1 parent 26c6c41 commit a134930

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
static-checks:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Use Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
20+
- name: Syntax check for shell scripts
21+
run: |
22+
while IFS= read -r file; do bash -n "$file"; done < <(
23+
find . -type f \( -name '*.sh' -o -name '*.command' \) \
24+
! -path '*/release/*' -print
25+
)
26+
27+
- name: Syntax check for Node.js scripts
28+
run: |
29+
while IFS= read -r file; do node --check "$file" >/dev/null; done < <(
30+
find . -type f \( -name '*.mjs' -o -name '*.js' \) -print
31+
)
32+
33+
- name: Grep assertions (Legacy identifiers)
34+
run: |
35+
if grep -R -n -E 'dream-skin-skin|DREAM_SKIN_SKIN|1\.0\.0-rc2' ./macos/scripts ./assets >/dev/null 2>&1; then
36+
printf 'Legacy release-candidate identifiers remain in runtime files.\n' >&2
37+
exit 1
38+
fi
39+
40+
- name: Grep assertions (app.asar mutation)
41+
run: |
42+
if grep -R -n -E '(writeFile|rename|copyFile|rm).*app\.asar' ./macos/scripts >/dev/null 2>&1; then
43+
printf 'A runtime script appears to mutate app.asar.\n' >&2
44+
exit 1
45+
fi
46+
47+
- name: Grep assertions (python3 / eval in common-macos.sh)
48+
run: |
49+
if grep -n -E '/usr/bin/python3|(^|[[:space:]])eval([[:space:]]|$)' ./macos/scripts/common-macos.sh >/dev/null 2>&1; then
50+
printf 'The shared macOS runtime must parse state with the bundled Node.js, without python3 or eval.\n' >&2
51+
exit 1
52+
fi
53+
54+
- name: Version consistency and HOME recovery assertion
55+
run: |
56+
/usr/bin/env -u HOME bash -c '. "$1/macos/scripts/common-macos.sh"; [ -n "$HOME" ] && [ "$SKIN_VERSION" = "$(cat "$1/VERSION" 2>/dev/null | tr -d '\''\n\r'\'')" ]' _ "."

0 commit comments

Comments
 (0)