-
Notifications
You must be signed in to change notification settings - Fork 1.3k
149 lines (132 loc) · 4.79 KB
/
Copy pathci.yml
File metadata and controls
149 lines (132 loc) · 4.79 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
static-checks:
name: Static checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Check shell syntax
shell: bash
run: |
while IFS= read -r file; do
bash -n "$file"
done < <(
find macos -type f \( -name '*.sh' -o -name '*.command' \) \
! -path '*/release/*' -print
)
- name: Check Node.js syntax
shell: bash
run: |
while IFS= read -r file; do
node --check "$file" >/dev/null
done < <(
find macos windows -type f \( -name '*.mjs' -o -name '*.js' \) -print
)
- name: Check Windows PowerShell source encoding
shell: bash
run: |
node <<'NODE'
const fs = require("node:fs");
const path = require("node:path");
function visit(directory) {
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
const file = path.join(directory, entry.name);
if (entry.isDirectory()) visit(file);
if (!entry.isFile() || path.extname(file) !== ".ps1") continue;
const bytes = fs.readFileSync(file);
const hasBom = bytes.subarray(0, 3).equals(Buffer.from([0xef, 0xbb, 0xbf]));
const content = hasBom ? bytes.subarray(3) : bytes;
if (content.some((byte) => byte >= 0x80) && !hasBom) {
throw new Error(`${file}: non-ASCII PowerShell 5.1 source requires a UTF-8 BOM`);
}
}
}
visit("windows");
NODE
- name: Check runtime safety assertions
shell: bash
run: |
if grep -R -n -E 'dream-skin-skin|DREAM_SKIN_SKIN|1\.0\.0-rc2' \
macos/scripts macos/assets >/dev/null; then
printf 'Legacy release-candidate identifiers remain in runtime files.\n' >&2
exit 1
fi
if grep -R -n -E '(writeFile|rename|copyFile|rm).*app\.asar' \
macos/scripts >/dev/null; then
printf 'A runtime script appears to mutate app.asar.\n' >&2
exit 1
fi
if grep -n -E '/usr/bin/python3|(^|[[:space:]])eval([[:space:]]|$)' \
macos/scripts/common-macos.sh >/dev/null; then
printf 'The macOS runtime must parse state without python3 or eval.\n' >&2
exit 1
fi
- name: Check version consistency
shell: bash
run: |
expected="$(tr -d '\r\n' < macos/VERSION)"
common="$(sed -n 's/^SKIN_VERSION="\([^"]*\)"$/\1/p' macos/scripts/common-macos.sh)"
macos_injector="$(sed -n 's/^const SKIN_VERSION = "\([^"]*\)";$/\1/p' macos/scripts/injector.mjs)"
windows_injector="$(sed -n 's/^const SKIN_VERSION = "\([^"]*\)";$/\1/p' windows/scripts/injector.mjs)"
test -n "$expected"
test "$common" = "$expected"
test "$macos_injector" = "$expected"
test "$windows_injector" = "$expected"
- name: Run portable Node.js regressions
shell: bash
run: |
node --test macos/tests/*.test.mjs
node --test windows/tests/*.test.mjs
node macos/scripts/injector.mjs --check-payload >/dev/null
node windows/scripts/injector.mjs --check-payload >/dev/null
windows-tests:
name: Windows (${{ matrix.name }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- name: Windows PowerShell 5.1
executable: powershell.exe
- name: PowerShell 7
executable: pwsh.exe
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Run Windows regression suite
shell: cmd
run: ${{ matrix.executable }} -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\windows\tests\run-tests.ps1
macos-tests:
name: macOS repository regressions
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Locate runner Node.js
id: node
shell: bash
run: echo "path=$(command -v node)" >> "$GITHUB_OUTPUT"
- name: Run macOS regressions without installed-app checks
shell: bash
env:
NODE: ${{ steps.node.outputs.path }}
CODEX_DREAM_SKIN_SKIP_SIGNED_RUNTIME_TESTS: "1"
CODEX_DREAM_SKIN_SKIP_DOCTOR: "1"
run: ./macos/tests/run-tests.sh