-
Notifications
You must be signed in to change notification settings - Fork 1
152 lines (127 loc) · 4.71 KB
/
ci.yml
File metadata and controls
152 lines (127 loc) · 4.71 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
150
name: CI
on:
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
ACESTEP_CPP_REPO: https://github.com/audiohacking/acestep.cpp.git
jobs:
# ─────────────────────────────────────────────
# 1. React / Vite frontend
# ─────────────────────────────────────────────
frontend:
name: Frontend (TypeScript + Vite build)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm install
- name: TypeScript check
run: ./node_modules/.bin/tsc --noEmit
- name: Vite build
run: npm run build
- name: Upload frontend artifact
uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: dist/
retention-days: 7
# ─────────────────────────────────────────────
# 2. Node.js Express server
# ─────────────────────────────────────────────
server:
name: Server (TypeScript compile)
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: server/package-lock.json
- name: Install dependencies
run: npm ci
- name: TypeScript check
run: npx tsc --noEmit
- name: TypeScript compile
run: npm run build
- name: Upload server artifact
uses: actions/upload-artifact@v4
with:
name: server-dist
path: server/dist/
retention-days: 7
# ─────────────────────────────────────────────
# 3. Test build.sh (the deployment build script)
# Validates that build.sh correctly clones
# acestep.cpp, compiles it, and installs the
# binaries to bin/ — exactly as it will run
# on the end user's machine at first launch.
# ─────────────────────────────────────────────
test-build-script:
name: Test build.sh (${{ matrix.label }})
runs-on: ${{ matrix.runner }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- label: linux-x64
runner: ubuntu-22.04
os: linux
- label: macos-arm64
runner: macos-14
os: macos
steps:
- uses: actions/checkout@v4
# ── Install build prerequisites (same as a user would need) ──────────
- name: Install build tools (Linux)
if: matrix.os == 'linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y cmake libssl-dev pkg-config
- name: Install build tools (macOS)
if: matrix.os == 'macos'
run: brew install cmake
# ── Cache the acestep.cpp build directory ────────────────────────────
- name: Cache acestep.cpp build
uses: actions/cache@v4
with:
path: |
acestep.cpp
bin
key: build-script-${{ matrix.label }}-${{ hashFiles('build.sh') }}-${{ env.ACESTEP_CPP_REPO }}
restore-keys: build-script-${{ matrix.label }}-
# ── Run the real deployment build script (CPU-only on CI runners) ────
- name: Run build.sh
run: bash build.sh --cpu
# ── Verify expected binaries were installed to bin/ ──────────────────
- name: Verify installed binaries
shell: bash
run: |
ALL_OK=1
for bin in ace-lm ace-synth neural-codec; do
if [ -x "bin/$bin" ]; then
echo "✅ bin/$bin"
else
echo "⚠️ bin/$bin not found or not executable"
ALL_OK=0
fi
done
[ "$ALL_OK" = "1" ] || { echo "One or more binaries missing"; exit 1; }
- name: Upload binaries artifact
uses: actions/upload-artifact@v4
with:
name: ci-bin-${{ matrix.label }}
path: bin/
if-no-files-found: warn
retention-days: 7