-
-
Notifications
You must be signed in to change notification settings - Fork 15
100 lines (84 loc) · 2.39 KB
/
Copy pathci.yml
File metadata and controls
100 lines (84 loc) · 2.39 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
# Detect which files changed to decide which jobs to run
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
app: ${{ steps.filter.outputs.app }}
web: ${{ steps.filter.outputs.web }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check paths
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
app:
- 'Sources/**'
- 'Tests/**'
- 'Package.swift'
- 'Package.resolved'
- 'scripts/**'
- 'Makefile'
- 'VocaMac.entitlements'
web:
- 'web/**'
# Build and test Swift app (only when app source changes)
build-and-test:
name: Build & Test App
needs: changes
if: needs.changes.outputs.app == 'true'
runs-on: macos-15
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache SPM dependencies
uses: actions/cache@v4
with:
path: .build
key: spm-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
spm-${{ runner.os }}-
- name: Build (Debug)
run: swift build
- name: Test
run: swift test
- name: Build (Release)
run: swift build -c release
- name: Initialize Xcode tools
run: sudo xcodebuild -runFirstLaunch
- name: Verify app bundle
run: |
./scripts/build.sh release
test -d VocaMac.app || exit 1
codesign -v VocaMac.app || echo "Codesign verification note: expected for ad-hoc CI builds"
test -f VocaMac.app/Contents/Resources/Assets.car || echo "⚠️ Assets.car missing"
echo "App bundle verified"
# Build website (only when web files change)
build-website:
name: Build Website
needs: changes
if: needs.changes.outputs.web == 'true'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build Hugo site
run: cd web && hugo --minify