Skip to content

Commit 170a75f

Browse files
pszymkowiakclaude
andcommitted
feat: parallelize CI and fix release workflow for macOS
CI: split into parallel check (fmt+clippy) and test jobs with cache fallback. Release: merge build+release into single macOS job, fix sha256sum → shasum -a 256, add cargo cache. Fix stop hook to use absolute path for vox binary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent db2296c commit 170a75f

3 files changed

Lines changed: 56 additions & 53 deletions

File tree

.claude/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"hooks": [
66
{
7-
"command": "vox -b say \"Terminé.\"",
7+
"command": "/Users/patrick/.cargo/bin/vox -b say \"Terminé.\"",
88
"type": "command"
99
}
1010
],

.github/workflows/ci.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13-
test:
13+
check:
1414
runs-on: macos-latest
1515
steps:
1616
- uses: actions/checkout@v4
@@ -25,13 +25,34 @@ jobs:
2525
~/.cargo/registry
2626
~/.cargo/git
2727
target
28-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
29-
30-
- name: Run tests
31-
run: cargo test
28+
key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-cargo-check-
3231
3332
- name: Check formatting
3433
run: cargo fmt -- --check
3534

3635
- name: Clippy
3736
run: cargo clippy -- -D warnings
37+
38+
test:
39+
runs-on: macos-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Install Rust
44+
uses: dtolnay/rust-toolchain@stable
45+
46+
- name: Cache cargo
47+
uses: actions/cache@v4
48+
with:
49+
path: |
50+
~/.cargo/registry
51+
~/.cargo/git
52+
target
53+
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
54+
restore-keys: |
55+
${{ runner.os }}-cargo-test-
56+
57+
- name: Run tests
58+
run: cargo test

.github/workflows/release.yml

Lines changed: 29 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,9 @@ env:
2222
CARGO_TERM_COLOR: always
2323

2424
jobs:
25-
build:
26-
name: Build ${{ matrix.target }}
27-
runs-on: ${{ matrix.os }}
28-
strategy:
29-
fail-fast: false
30-
matrix:
31-
include:
32-
- target: x86_64-apple-darwin
33-
os: macos-latest
34-
archive: tar.gz
35-
- target: aarch64-apple-darwin
36-
os: macos-latest
37-
archive: tar.gz
25+
build-and-release:
26+
name: Build and upload release assets
27+
runs-on: macos-latest
3828

3929
steps:
4030
- name: Checkout
@@ -43,35 +33,37 @@ jobs:
4333
- name: Install Rust
4434
uses: dtolnay/rust-toolchain@stable
4535
with:
46-
targets: ${{ matrix.target }}
36+
targets: x86_64-apple-darwin,aarch64-apple-darwin
4737

48-
- name: Build
49-
run: cargo build --release --target ${{ matrix.target }}
38+
- name: Cache cargo
39+
uses: actions/cache@v4
40+
with:
41+
path: |
42+
~/.cargo/registry
43+
~/.cargo/git
44+
target
45+
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
46+
restore-keys: |
47+
${{ runner.os }}-cargo-release-
5048
51-
- name: Package
52-
run: |
53-
cd target/${{ matrix.target }}/release
54-
tar -czvf ../../../vox-${{ matrix.target }}.${{ matrix.archive }} vox
55-
cd ../../..
49+
- name: Build aarch64-apple-darwin
50+
run: cargo build --release --target aarch64-apple-darwin
5651

57-
- name: Upload artifact
58-
uses: actions/upload-artifact@v4
59-
with:
60-
name: vox-${{ matrix.target }}
61-
path: vox-${{ matrix.target }}.${{ matrix.archive }}
52+
- name: Build x86_64-apple-darwin
53+
run: cargo build --release --target x86_64-apple-darwin
6254

63-
release:
64-
name: Create Release
65-
needs: [build]
66-
runs-on: ubuntu-latest
67-
steps:
68-
- name: Checkout
69-
uses: actions/checkout@v4
55+
- name: Package
56+
run: |
57+
mkdir -p release
58+
cd target/aarch64-apple-darwin/release
59+
tar -czvf ../../../release/vox-aarch64-apple-darwin.tar.gz vox
60+
cd ../../../target/x86_64-apple-darwin/release
61+
tar -czvf ../../../release/vox-x86_64-apple-darwin.tar.gz vox
7062
71-
- name: Download all artifacts
72-
uses: actions/download-artifact@v4
73-
with:
74-
path: artifacts
63+
- name: Create checksums
64+
run: |
65+
cd release
66+
shasum -a 256 *.tar.gz > checksums.txt
7567
7668
- name: Get version
7769
id: version
@@ -84,16 +76,6 @@ jobs:
8476
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
8577
fi
8678
87-
- name: Flatten artifacts
88-
run: |
89-
mkdir -p release
90-
find artifacts -type f -name "*.tar.gz" -exec cp {} release/ \;
91-
92-
- name: Create checksums
93-
run: |
94-
cd release
95-
sha256sum * > checksums.txt
96-
9779
- name: Upload Release Assets
9880
if: github.event_name == 'release' || github.event_name == 'workflow_call'
9981
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)