Skip to content

Commit 951407f

Browse files
committed
ci: determine platform MSRV with JACK
1 parent 1162be5 commit 951407f

File tree

3 files changed

+84
-10
lines changed

3 files changed

+84
-10
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Determine MSRV for all-features
2+
description: Computes the maximum MSRV needed for --all-features tests (platform vs JACK)
3+
4+
inputs:
5+
platform-msrv:
6+
description: The MSRV for the platform backend (e.g., ALSA, CoreAudio, Windows)
7+
required: true
8+
jack-msrv:
9+
description: The MSRV for JACK backend
10+
required: true
11+
12+
outputs:
13+
all-features:
14+
description: The maximum MSRV to use for --all-features tests
15+
value: ${{ steps.compare.outputs.all-features }}
16+
17+
runs:
18+
using: composite
19+
steps:
20+
- name: Compare versions
21+
id: compare
22+
shell: bash
23+
run: |
24+
PLATFORM_MSRV="${{ inputs.platform-msrv }}"
25+
JACK_MSRV="${{ inputs.jack-msrv }}"
26+
# Use sort -V to find the maximum version
27+
MAX_MSRV=$(printf '%s\n' "$PLATFORM_MSRV" "$JACK_MSRV" | sort -V | tail -n1)
28+
echo "all-features=$MAX_MSRV" >> $GITHUB_OUTPUT
29+
echo "Platform MSRV: $PLATFORM_MSRV, JACK MSRV: $JACK_MSRV, Using for --all-features: $MAX_MSRV"

.github/workflows/platforms.yml

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,23 @@ jobs:
6161
with:
6262
packages: ${{ env.PACKAGES_LINUX }}
6363

64+
- name: Determine MSRV for all-features
65+
id: msrv
66+
uses: ./.github/actions/determine-msrv
67+
with:
68+
platform-msrv: ${{ env.MSRV_ALSA }}
69+
jack-msrv: ${{ env.MSRV_JACK }}
70+
6471
- name: Install Rust MSRV (${{ env.MSRV_ALSA }})
6572
uses: dtolnay/rust-toolchain@master
6673
with:
6774
toolchain: ${{ env.MSRV_ALSA }}
6875

69-
- name: Install Rust MSRV (${{ env.MSRV_JACK }})
76+
- name: Install Rust MSRV (${{ steps.msrv.outputs.all-features }})
77+
if: steps.msrv.outputs.all-features != env.MSRV_ALSA
7078
uses: dtolnay/rust-toolchain@master
7179
with:
72-
toolchain: ${{ env.MSRV_JACK }}
80+
toolchain: ${{ steps.msrv.outputs.all-features }}
7381

7482
- name: Rust Cache
7583
uses: Swatinem/rust-cache@v2
@@ -83,24 +91,32 @@ jobs:
8391
run: cargo +${{ env.MSRV_ALSA }} test --workspace --no-default-features --verbose
8492

8593
- name: Run tests (all features)
86-
run: cargo +${{ env.MSRV_JACK }} test --workspace --all-features --verbose
94+
run: cargo +${{ steps.msrv.outputs.all-features }} test --workspace --all-features --verbose
8795

8896
# Linux ARMv7 (cross-compilation)
8997
linux-armv7:
9098
runs-on: ubuntu-latest
9199
steps:
92100
- uses: actions/checkout@v5
93101

102+
- name: Determine MSRV for all-features
103+
id: msrv
104+
uses: ./.github/actions/determine-msrv
105+
with:
106+
platform-msrv: ${{ env.MSRV_ALSA }}
107+
jack-msrv: ${{ env.MSRV_JACK }}
108+
94109
- name: Install Rust MSRV (${{ env.MSRV_ALSA }})
95110
uses: dtolnay/rust-toolchain@master
96111
with:
97112
toolchain: ${{ env.MSRV_ALSA }}
98113
targets: armv7-unknown-linux-gnueabihf
99114

100-
- name: Install Rust MSRV (${{ env.MSRV_JACK }})
115+
- name: Install Rust MSRV (${{ steps.msrv.outputs.all-features }})
116+
if: steps.msrv.outputs.all-features != env.MSRV_ALSA
101117
uses: dtolnay/rust-toolchain@master
102118
with:
103-
toolchain: ${{ env.MSRV_JACK }}
119+
toolchain: ${{ steps.msrv.outputs.all-features }}
104120
targets: armv7-unknown-linux-gnueabihf
105121

106122
- name: Rust Cache
@@ -117,7 +133,7 @@ jobs:
117133
run: cross +${{ env.MSRV_ALSA }} test --target armv7-unknown-linux-gnueabihf --workspace --no-default-features --verbose
118134

119135
- name: Run tests (all features)
120-
run: cross +${{ env.MSRV_JACK }} test --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose
136+
run: cross +${{ steps.msrv.outputs.all-features }} test --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose
121137

122138
# Windows (x86_64 and i686)
123139
windows:
@@ -140,22 +156,36 @@ jobs:
140156
- name: Setup ASIO SDK
141157
uses: ./.github/actions/setup-asio
142158

159+
- name: Determine MSRV for all-features
160+
id: msrv
161+
uses: ./.github/actions/determine-msrv
162+
with:
163+
platform-msrv: ${{ env.MSRV_WINDOWS }}
164+
jack-msrv: ${{ env.MSRV_JACK }}
165+
143166
- name: Install Rust MSRV (${{ env.MSRV_WINDOWS }})
144167
uses: dtolnay/rust-toolchain@master
145168
with:
146169
toolchain: ${{ env.MSRV_WINDOWS }}
147170
targets: ${{ env.TARGET }}
148171

172+
- name: Install Rust MSRV (${{ steps.msrv.outputs.all-features }})
173+
if: steps.msrv.outputs.all-features != env.MSRV_WINDOWS
174+
uses: dtolnay/rust-toolchain@master
175+
with:
176+
toolchain: ${{ steps.msrv.outputs.all-features }}
177+
targets: ${{ env.TARGET }}
178+
149179
- name: Rust Cache
150180
uses: Swatinem/rust-cache@v2
151181
with:
152182
key: windows-${{ matrix.arch }}
153183

154184
- name: Run tests (no features)
155-
run: cargo test --workspace --no-default-features --verbose
185+
run: cargo +${{ env.MSRV_WINDOWS }} test --workspace --no-default-features --verbose
156186

157187
- name: Run tests (all features)
158-
run: cargo test --workspace --all-features --verbose
188+
run: cargo +${{ steps.msrv.outputs.all-features }} test --workspace --all-features --verbose
159189

160190
- name: Check examples
161191
working-directory: asio-sys
@@ -170,22 +200,35 @@ jobs:
170200
- name: Install dependencies
171201
run: brew install llvm
172202

203+
- name: Determine MSRV for all-features
204+
id: msrv
205+
uses: ./.github/actions/determine-msrv
206+
with:
207+
platform-msrv: ${{ env.MSRV_COREAUDIO }}
208+
jack-msrv: ${{ env.MSRV_JACK }}
209+
173210
- name: Install Rust MSRV (${{ env.MSRV_COREAUDIO }})
174211
uses: dtolnay/rust-toolchain@master
175212
with:
176213
toolchain: ${{ env.MSRV_COREAUDIO }}
177214

215+
- name: Install Rust MSRV (${{ steps.msrv.outputs.all-features }})
216+
if: steps.msrv.outputs.all-features != env.MSRV_COREAUDIO
217+
uses: dtolnay/rust-toolchain@master
218+
with:
219+
toolchain: ${{ steps.msrv.outputs.all-features }}
220+
178221
- name: Rust Cache
179222
uses: Swatinem/rust-cache@v2
180223

181224
- name: Check examples
182225
run: cargo check --examples --verbose --workspace
183226

184227
- name: Run tests (no features)
185-
run: cargo test --workspace --no-default-features --verbose
228+
run: cargo +${{ env.MSRV_COREAUDIO }} test --workspace --no-default-features --verbose
186229

187230
- name: Run tests (all features)
188-
run: cargo test --workspace --all-features --verbose
231+
run: cargo +${{ steps.msrv.outputs.all-features }} test --workspace --all-features --verbose
189232

190233
# Android
191234
android:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Added
11+
1112
- **ALSA**: `Default` implementation for `Device` (returns the ALSA "default" device).
13+
- **CI**: Determines MSRV for JACK per platform.
1214

1315
### Fixed
1416

0 commit comments

Comments
 (0)