Skip to content

Commit ffab09a

Browse files
committed
refactor: use dedicated jobs per OS instead of matrix
- test.yml: explicit test-linux, test-macos, test-windows jobs - build.yml: explicit build-linux, build-macos, build-windows jobs - Remove matrix strategy and OS conditionals - Cleaner, easier to maintain
1 parent b189509 commit ffab09a

2 files changed

Lines changed: 53 additions & 32 deletions

File tree

.github/workflows/build.yml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,39 @@ env:
77
CARGO_TERM_COLOR: always
88

99
jobs:
10-
build:
11-
name: Build Release
12-
strategy:
13-
matrix:
14-
os: [ubuntu-latest, macos-latest, windows-latest]
15-
include:
16-
- os: ubuntu-latest
17-
container: rust:1.75-slim
18-
runs-on: ${{ matrix.os }}
19-
container: ${{ matrix.container || null }}
10+
build-linux:
11+
name: Build Linux
12+
runs-on: ubuntu-latest
13+
container: rust:1.75-slim
2014
steps:
2115
- uses: actions/checkout@v4
22-
- if: matrix.os == 'ubuntu-latest'
23-
run: apt-get update && apt-get install -y pkg-config libssl-dev
24-
- if: matrix.os != 'ubuntu-latest'
25-
uses: dtolnay/[email protected]
16+
- run: apt-get update && apt-get install -y pkg-config libssl-dev
2617
- run: cargo build --release
27-
- name: Upload artifact
28-
uses: actions/upload-artifact@v4
18+
- uses: actions/upload-artifact@v4
2919
with:
30-
name: gitclaw-${{ matrix.os }}
31-
path: target/release/gitclaw${{ matrix.os == 'windows-latest' && '.exe' || '' }}
20+
name: gitclaw-linux
21+
path: target/release/gitclaw
22+
23+
build-macos:
24+
name: Build macOS
25+
runs-on: macos-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dtolnay/[email protected]
29+
- run: cargo build --release
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: gitclaw-macos
33+
path: target/release/gitclaw
34+
35+
build-windows:
36+
name: Build Windows
37+
runs-on: windows-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: dtolnay/[email protected]
41+
- run: cargo build --release
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
name: gitclaw-windows
45+
path: target/release/gitclaw.exe

.github/workflows/test.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,27 @@ env:
77
CARGO_TERM_COLOR: always
88

99
jobs:
10-
test:
11-
name: Test
12-
strategy:
13-
matrix:
14-
os: [ubuntu-latest, macos-latest, windows-latest]
15-
include:
16-
- os: ubuntu-latest
17-
container: rust:1.75-slim
18-
runs-on: ${{ matrix.os }}
19-
container: ${{ matrix.container || null }}
10+
test-linux:
11+
name: Test Linux
12+
runs-on: ubuntu-latest
13+
container: rust:1.75-slim
2014
steps:
2115
- uses: actions/checkout@v4
22-
- if: matrix.os == 'ubuntu-latest'
23-
run: apt-get update && apt-get install -y pkg-config libssl-dev
24-
- if: matrix.os != 'ubuntu-latest'
25-
uses: dtolnay/[email protected]
16+
- run: apt-get update && apt-get install -y pkg-config libssl-dev
17+
- run: cargo test
18+
19+
test-macos:
20+
name: Test macOS
21+
runs-on: macos-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: dtolnay/[email protected]
25+
- run: cargo test
26+
27+
test-windows:
28+
name: Test Windows
29+
runs-on: windows-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: dtolnay/[email protected]
2633
- run: cargo test

0 commit comments

Comments
 (0)