Skip to content

Commit 9ae8206

Browse files
CodeGhost21claude
andcommitted
Enhance CI workflows: multi-platform build, Rust quality gates, Windows release target
- build.yml: add rust-quality job (cargo fmt + clippy), matrix for Linux x86_64 and macOS ARM64 - test.yml: add cargo fmt, clippy checks to rust-tests job - release.yml: add Windows x86_64 target with .exe sidecar handling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 550222d commit 9ae8206

3 files changed

Lines changed: 105 additions & 21 deletions

File tree

.github/workflows/build.yml

Lines changed: 67 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,68 @@ permissions:
99
pull-requests: read
1010

1111
concurrency:
12-
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.ref }}
1313
cancel-in-progress: true
1414

1515
jobs:
16-
test-build:
17-
name: Build Tauri App
16+
rust-quality:
17+
name: Rust Quality (fmt + clippy)
1818
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 1
24+
25+
- name: Install Rust (rust-toolchain.toml)
26+
uses: dtolnay/rust-toolchain@1.93.0
27+
with:
28+
components: rustfmt, clippy
29+
30+
- name: Install Tauri build dependencies
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
34+
35+
- name: Cargo.lock fingerprint (deps only)
36+
id: cargo-lock-fingerprint
37+
shell: bash
38+
run: |
39+
echo "hash=$(tail -n +8 Cargo.lock | openssl dgst -sha256 | awk '{print $2}')" >> "$GITHUB_OUTPUT"
40+
41+
- name: Cache Cargo registry and git sources
42+
uses: actions/cache@v4
43+
with:
44+
path: |
45+
~/.cargo/registry
46+
~/.cargo/git
47+
key: ${{ runner.os }}-cargo-registry-${{ steps.cargo-lock-fingerprint.outputs.hash }}
48+
restore-keys: |
49+
${{ runner.os }}-cargo-registry-
50+
51+
- name: Check formatting (cargo fmt)
52+
run: cargo fmt --all -- --check
53+
54+
- name: Run clippy (core crate)
55+
run: cargo clippy -p openhuman -- -D warnings
56+
57+
- name: Run clippy (Tauri shell)
58+
run: cargo clippy --manifest-path app/src-tauri/Cargo.toml -- -D warnings
59+
60+
build:
61+
name: Build Tauri App (${{ matrix.settings.label }})
62+
needs: rust-quality
63+
runs-on: ${{ matrix.settings.platform }}
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
settings:
68+
- platform: ubuntu-22.04
69+
target: x86_64-unknown-linux-gnu
70+
label: Linux x86_64
71+
- platform: macos-latest
72+
target: aarch64-apple-darwin
73+
label: macOS ARM64
1974
steps:
2075
- name: Checkout code
2176
uses: actions/checkout@v4
@@ -29,12 +84,13 @@ jobs:
2984
node-version: 24.x
3085
cache: "yarn"
3186

32-
- name: Install Rust stable
87+
- name: Install Rust (rust-toolchain.toml)
3388
uses: dtolnay/rust-toolchain@1.93.0
3489
with:
35-
targets: x86_64-unknown-linux-gnu
90+
targets: ${{ matrix.settings.target }}
3691

37-
- name: Install Tauri dependencies
92+
- name: Install Tauri dependencies (Linux)
93+
if: matrix.settings.platform == 'ubuntu-22.04'
3894
run: |
3995
sudo apt-get update
4096
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
@@ -70,19 +126,19 @@ jobs:
70126
run: yarn install --frozen-lockfile
71127

72128
- name: Build sidecar core binary
73-
run: cargo build --manifest-path Cargo.toml --release --target x86_64-unknown-linux-gnu --bin openhuman
129+
run: cargo build --manifest-path Cargo.toml --release --target ${{ matrix.settings.target }} --bin openhuman
74130

75131
- name: Stage sidecar for Tauri bundler
132+
shell: bash
76133
run: |
77134
mkdir -p app/src-tauri/binaries
78-
# Release artifacts for the root package land in repo root target/
79-
cp target/x86_64-unknown-linux-gnu/release/openhuman app/src-tauri/binaries/openhuman-x86_64-unknown-linux-gnu
80-
chmod +x app/src-tauri/binaries/openhuman-x86_64-unknown-linux-gnu
135+
cp target/${{ matrix.settings.target }}/release/openhuman app/src-tauri/binaries/openhuman-${{ matrix.settings.target }}
136+
chmod +x app/src-tauri/binaries/openhuman-${{ matrix.settings.target }}
81137
82138
- name: Build Tauri app
83139
working-directory: app
84140
run: |
85141
TAURI_CONFIG_OVERRIDE='{"bundle":{"createUpdaterArtifacts":false}}'
86-
yarn tauri build -c "$TAURI_CONFIG_OVERRIDE" --bundles none -- --target x86_64-unknown-linux-gnu
142+
yarn tauri build -c "$TAURI_CONFIG_OVERRIDE" --bundles none --target ${{ matrix.settings.target }} -- --bin OpenHuman
87143
env:
88144
NODE_ENV: production

.github/workflows/release.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ jobs:
221221
args: --target x86_64-unknown-linux-gnu
222222
target: x86_64-unknown-linux-gnu
223223
artifact_suffix: ubuntu
224+
- platform: windows-latest
225+
args: --target x86_64-pc-windows-msvc
226+
target: x86_64-pc-windows-msvc
227+
artifact_suffix: windows
224228
env:
225229
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
226230
steps:
@@ -376,10 +380,16 @@ jobs:
376380
shell: bash
377381
run: |
378382
mkdir -p app/src-tauri/binaries
379-
SOURCE="$CORE_TARGET_DIR/$CORE_BIN_NAME"
380-
DEST="app/src-tauri/binaries/$SIDECAR_BASE-$MATRIX_TARGET"
383+
EXE_SUFFIX=""
384+
if [[ "$MATRIX_TARGET" == *"windows"* ]]; then
385+
EXE_SUFFIX=".exe"
386+
fi
387+
SOURCE="$CORE_TARGET_DIR/${CORE_BIN_NAME}${EXE_SUFFIX}"
388+
DEST="app/src-tauri/binaries/${SIDECAR_BASE}-${MATRIX_TARGET}${EXE_SUFFIX}"
381389
cp "$SOURCE" "$DEST"
382-
chmod +x "$DEST"
390+
if [[ "$MATRIX_TARGET" != *"windows"* ]]; then
391+
chmod +x "$DEST"
392+
fi
383393
env:
384394
MATRIX_TARGET: ${{ matrix.settings.target }}
385395
CORE_TARGET_DIR: ${{ steps.core-paths.outputs.core_target_dir }}
@@ -389,7 +399,11 @@ jobs:
389399
- name: Verify staged sidecar for bundler (all platforms)
390400
shell: bash
391401
run: |
392-
SIDE_CAR_PATH="app/src-tauri/binaries/$SIDECAR_BASE-$MATRIX_TARGET"
402+
EXE_SUFFIX=""
403+
if [[ "$MATRIX_TARGET" == *"windows"* ]]; then
404+
EXE_SUFFIX=".exe"
405+
fi
406+
SIDE_CAR_PATH="app/src-tauri/binaries/${SIDECAR_BASE}-${MATRIX_TARGET}${EXE_SUFFIX}"
393407
echo "Checking staged sidecar: $SIDE_CAR_PATH"
394408
if [ ! -f "$SIDE_CAR_PATH" ]; then
395409
echo "Missing staged sidecar binary: $SIDE_CAR_PATH"
@@ -409,8 +423,12 @@ jobs:
409423
shell: bash
410424
run: |
411425
BASE_DIR="$CORE_TARGET_DIR"
426+
EXE_SUFFIX=""
427+
if [[ "$MATRIX_TARGET" == *"windows"* ]]; then
428+
EXE_SUFFIX=".exe"
429+
fi
412430
echo "base_dir=$BASE_DIR" >> "$GITHUB_OUTPUT"
413-
echo "cli_path=$BASE_DIR/$CORE_BIN_NAME" >> "$GITHUB_OUTPUT"
431+
echo "cli_path=$BASE_DIR/${CORE_BIN_NAME}${EXE_SUFFIX}" >> "$GITHUB_OUTPUT"
414432
env:
415433
MATRIX_TARGET: ${{ matrix.settings.target }}
416434
CORE_TARGET_DIR: ${{ steps.core-paths.outputs.core_target_dir }}

.github/workflows/test.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16-
test:
17-
name: Run Unit Tests
16+
unit-tests:
17+
name: Frontend Unit Tests
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout code
@@ -56,7 +56,7 @@ jobs:
5656
retention-days: 7
5757

5858
rust-tests:
59-
name: Run Rust Tests
59+
name: Rust Tests + Quality
6060
runs-on: ubuntu-22.04
6161
steps:
6262
- name: Checkout code
@@ -67,6 +67,7 @@ jobs:
6767
- name: Install Rust (rust-toolchain.toml)
6868
uses: dtolnay/rust-toolchain@1.93.0
6969
with:
70+
components: rustfmt, clippy
7071
targets: x86_64-unknown-linux-gnu
7172

7273
- name: Install Tauri build dependencies
@@ -91,10 +92,19 @@ jobs:
9192
restore-keys: |
9293
${{ runner.os }}-rust-test-cargo-
9394
94-
- name: Test rust-core (openhuman)
95+
- name: Check formatting (cargo fmt)
96+
run: cargo fmt --all -- --check
97+
98+
- name: Run clippy (core crate)
99+
run: cargo clippy -p openhuman -- -D warnings
100+
101+
- name: Run clippy (Tauri shell)
102+
run: cargo clippy --manifest-path app/src-tauri/Cargo.toml -- -D warnings
103+
104+
- name: Test core crate (openhuman)
95105
run: cargo test -p openhuman
96106

97-
- name: Test src-tauri (OpenHuman)
107+
- name: Test Tauri shell (OpenHuman)
98108
run: cargo test --manifest-path app/src-tauri/Cargo.toml
99109

100110
e2e-macos:

0 commit comments

Comments
 (0)