Skip to content

Commit 8d1453d

Browse files
committed
ci: standardize on runner.os
Prev we used `matrix.os` for taking OS specific actions. It's more reliable to use `runner.os` for this, since action names can be changed and the `runner.os` is a true reflection of the OS of the runner instance.
1 parent a362bdc commit 8d1453d

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

.github/workflows/artifacts.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ jobs:
195195
# than using `--define-prefix` - it seems to tack an extra 'lib/' subcomponent
196196
# onto the include path that breaks the build.
197197
- name: Fix pkg-config prefix (UNIX)
198-
if: matrix.os != 'windows-latest'
198+
if: runner.os != 'Windows'
199199
shell: bash
200200
# For further fun, sed isn't consistent between macOS and Linux.
201201
run: |
@@ -208,7 +208,7 @@ jobs:
208208
;;
209209
esac
210210
- name: Fix pkg-config prefix (Windows)
211-
if: matrix.os == 'windows-latest'
211+
if: runner.os == 'Windows'
212212
shell: pwsh
213213
run: |
214214
$prefix = (Get-Location).Path + "/${{ matrix.artifact }}"
@@ -227,7 +227,7 @@ jobs:
227227
# Set up the cmake build, overriding PKG_CONFIG_PATH to
228228
# point to the extracted rustls-ffi archive.
229229
- name: Setup cmake build (UNIX)
230-
if: matrix.os != 'windows-latest'
230+
if: runner.os != 'Windows'
231231
env:
232232
PKG_CONFIG_PATH: ${{ matrix.artifact }}/lib/pkgconfig
233233
run: cmake -S librustls -B build -DCMAKE_BUILD_TYPE=Release -DFORCE_SYSTEM_RUSTLS=ON
@@ -237,30 +237,30 @@ jobs:
237237
# For Windows cmake needs some help finding the strawberry perl pkg-config
238238
# that's installed in the runner's PATH.
239239
- name: Setup cmake build (Windows)
240-
if: matrix.os == 'windows-latest'
240+
if: runner.os == 'Windows'
241241
env:
242242
PKG_CONFIG_PATH: ${{ matrix.artifact }}/lib/pkgconfig
243243
run: cmake -DPKG_CONFIG_EXECUTABLE=C:\Strawberry\perl\bin\pkg-config.bat -DFORCE_SYSTEM_RUSTLS=ON -S librustls -B build
244244
# Build the client and server binaries
245245
- name: Build rustls-ffi client/server (UNIX)
246-
if: matrix.os != 'windows-latest'
246+
if: runner.os != 'Windows'
247247
run: cmake --build build -v
248248
# Build the client and server binaries
249249
# On Windows we need to specify a configuration to avoid a warning about using the default
250250
# debug MSCRT runtime with a lib built with the release MSCRT runtime.
251251
- name: Build rustls-ffi client/server (Windows)
252-
if: matrix.os == 'windows-latest'
252+
if: runner.os == 'Windows'
253253
run: cmake --build build --config Release -v
254254
# Run the rustls-ffi client binary.
255255
- name: Run rustls-ffi client (UNIX)
256-
if: matrix.os != 'windows-latest'
256+
if: runner.os != 'Windows'
257257
env:
258258
RUSTLS_PLATFORM_VERIFIER: 1
259259
run: ./build/tests/client example.com 443 / 1
260260
# Run the rustls-ffi-test binary.
261261
# On Windows it's in a different output location under build.
262262
- name: Run rustls-ffi client (Windows)
263-
if: matrix.os == 'windows-latest'
263+
if: runner.os == 'Windows'
264264
env:
265265
RUSTLS_PLATFORM_VERIFIER: 1
266266
run: .\build\tests\Release\client.exe example.com 443 / 1

.github/workflows/daily-tests.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ jobs:
2929
uses: dtolnay/rust-toolchain@nightly
3030

3131
- name: Install cargo-c (Ubuntu)
32-
if: matrix.os == 'ubuntu-latest'
32+
if: runner.os == 'Linux'
3333
env:
3434
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
3535
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz
3636
run: |
3737
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
3838
3939
- name: Install cargo-c (macOS)
40-
if: matrix.os == 'macos-latest'
40+
if: runner.os == 'macOS'
4141
env:
4242
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
4343
CARGO_C_FILE: cargo-c-macos.zip
@@ -46,7 +46,7 @@ jobs:
4646
unzip cargo-c-macos.zip -d ~/.cargo/bin
4747
4848
- name: Install cargo-c (Windows)
49-
if: matrix.os == 'windows-latest'
49+
if: runner.os == 'Windows'
5050
env:
5151
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
5252
CARGO_C_FILE: cargo-c-windows-msvc.zip
@@ -57,15 +57,15 @@ jobs:
5757
- name: Setup cmake build
5858
run: |
5959
cmake ${{
60-
matrix.os != 'windows-latest' && '-DCMAKE_BUILD_TYPE=Release \' || ''
60+
runner.os != 'Windows' && '-DCMAKE_BUILD_TYPE=Release \' || ''
6161
}} ${{
62-
matrix.os == 'macos-latest' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || ''
62+
runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || ''
6363
}} -S librustls -B build
6464
6565
- name: Run platform-verifier connect test
6666
run: |
6767
cmake --build build --target connect-test ${{
68-
matrix.os == 'windows-latest' && '--config Release' || ''
68+
runner.os == 'Windows' && '--config Release' || ''
6969
}}
7070
7171
ech:
@@ -85,15 +85,15 @@ jobs:
8585
uses: dtolnay/rust-toolchain@nightly
8686

8787
- name: Install cargo-c (Ubuntu)
88-
if: matrix.os == 'ubuntu-latest'
88+
if: runner.os == 'Linux'
8989
env:
9090
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
9191
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz
9292
run: |
9393
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
9494
9595
- name: Install cargo-c (macOS)
96-
if: matrix.os == 'macos-latest'
96+
if: runner.os == 'macOS'
9797
env:
9898
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
9999
CARGO_C_FILE: cargo-c-macos.zip
@@ -102,7 +102,7 @@ jobs:
102102
unzip cargo-c-macos.zip -d ~/.cargo/bin
103103
104104
- name: Install cargo-c (Windows)
105-
if: matrix.os == 'windows-latest'
105+
if: runner.os == 'Windows'
106106
env:
107107
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
108108
CARGO_C_FILE: cargo-c-windows-msvc.zip
@@ -113,17 +113,17 @@ jobs:
113113
- name: Setup cmake build
114114
run: |
115115
cmake ${{
116-
matrix.os != 'windows-latest' && '-DCMAKE_BUILD_TYPE=Release \' || ''
116+
runner.os != 'Windows' && '-DCMAKE_BUILD_TYPE=Release \' || ''
117117
}} ${{
118-
matrix.os == 'macos-latest' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || ''
118+
runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || ''
119119
}} -S librustls -B build
120120
121121
- name: Run ECH test
122122
# NOTE: uses bash as the shell to allow for easy no-powershell tee/grep pipeline.
123123
shell: bash
124124
run: |
125125
cmake --build build --target ech-test ${{
126-
matrix.os == 'windows-latest' && '--config Release' || ''
126+
runner.os == 'Windows' && '--config Release' || ''
127127
}} | tee ech-test.log
128128
129129
- name: Verify ECH status

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
toolchain: ${{ matrix.rust }}
8585

8686
- name: Install cargo-c (Ubuntu)
87-
if: matrix.os == 'ubuntu-latest'
87+
if: runner.os == 'Linux'
8888
env:
8989
# Version picked for MSRV compat.
9090
LINK: https://github.com/lu-zero/cargo-c/releases/download/v0.10.0
@@ -93,7 +93,7 @@ jobs:
9393
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
9494
9595
- name: Install cargo-c (macOS)
96-
if: matrix.os == 'macos-latest'
96+
if: runner.os == 'macOS'
9797
env:
9898
# Version picked for MSRV compat.
9999
LINK: https://github.com/lu-zero/cargo-c/releases/download/v0.10.0
@@ -112,7 +112,7 @@ jobs:
112112
-DPREFER_POST_QUANTUM=${{matrix.prefer-pq}} \
113113
-DDYN_LINK=${{matrix.dyn_link}} \
114114
-DCMAKE_BUILD_TYPE=Debug \
115-
${{ matrix.os == 'macos-latest' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || '' }} \
115+
${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || '' }} \
116116
-S librustls -B build
117117
118118
- name: Build

0 commit comments

Comments
 (0)