Skip to content

Commit 7baeecf

Browse files
committed
Add CI workflow to validate builds on push/PR
Runs on every push to main and pull requests: - Builds the Xcode project (unsigned) to catch compile errors - Validates manifest.json has required fields - Checks JavaScript files for syntax errors via Node This provides early feedback on PRs without requiring full code signing or notarization.
1 parent 9beb8d8 commit 7baeecf

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Build
18+
run: |
19+
xcodebuild build \
20+
-project "CF Cache Status/CF Cache Status.xcodeproj" \
21+
-scheme "CF Cache Status" \
22+
-destination "platform=macOS" \
23+
CODE_SIGN_IDENTITY="-" \
24+
CODE_SIGNING_REQUIRED=NO
25+
26+
- name: Validate manifest.json
27+
run: |
28+
python3 -c "
29+
import json
30+
import sys
31+
32+
with open('CF Cache Status/CF Cache Status Extension/Resources/manifest.json') as f:
33+
manifest = json.load(f)
34+
35+
required = ['manifest_version', 'name', 'version', 'permissions']
36+
missing = [k for k in required if k not in manifest]
37+
38+
if missing:
39+
print(f'Missing required fields: {missing}')
40+
sys.exit(1)
41+
42+
print('manifest.json is valid')
43+
print(f' Name: {manifest[\"name\"]}')
44+
print(f' Version: {manifest[\"version\"]}')
45+
"
46+
47+
- name: Lint JavaScript (syntax check)
48+
run: |
49+
for file in "CF Cache Status/CF Cache Status Extension/Resources/"*.js \
50+
"CF Cache Status/CF Cache Status Extension/"*.js; do
51+
if [ -f "$file" ]; then
52+
echo "Checking: $file"
53+
node --check "$file"
54+
fi
55+
done

0 commit comments

Comments
 (0)