Skip to content

Commit

Permalink
ci: standardize on runner.os
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cpu committed Feb 10, 2025
1 parent a362bdc commit 8d1453d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ jobs:
# than using `--define-prefix` - it seems to tack an extra 'lib/' subcomponent
# onto the include path that breaks the build.
- name: Fix pkg-config prefix (UNIX)
if: matrix.os != 'windows-latest'
if: runner.os != 'Windows'
shell: bash
# For further fun, sed isn't consistent between macOS and Linux.
run: |
Expand All @@ -208,7 +208,7 @@ jobs:
;;
esac
- name: Fix pkg-config prefix (Windows)
if: matrix.os == 'windows-latest'
if: runner.os == 'Windows'
shell: pwsh
run: |
$prefix = (Get-Location).Path + "/${{ matrix.artifact }}"
Expand All @@ -227,7 +227,7 @@ jobs:
# Set up the cmake build, overriding PKG_CONFIG_PATH to
# point to the extracted rustls-ffi archive.
- name: Setup cmake build (UNIX)
if: matrix.os != 'windows-latest'
if: runner.os != 'Windows'
env:
PKG_CONFIG_PATH: ${{ matrix.artifact }}/lib/pkgconfig
run: cmake -S librustls -B build -DCMAKE_BUILD_TYPE=Release -DFORCE_SYSTEM_RUSTLS=ON
Expand All @@ -237,30 +237,30 @@ jobs:
# For Windows cmake needs some help finding the strawberry perl pkg-config
# that's installed in the runner's PATH.
- name: Setup cmake build (Windows)
if: matrix.os == 'windows-latest'
if: runner.os == 'Windows'
env:
PKG_CONFIG_PATH: ${{ matrix.artifact }}/lib/pkgconfig
run: cmake -DPKG_CONFIG_EXECUTABLE=C:\Strawberry\perl\bin\pkg-config.bat -DFORCE_SYSTEM_RUSTLS=ON -S librustls -B build
# Build the client and server binaries
- name: Build rustls-ffi client/server (UNIX)
if: matrix.os != 'windows-latest'
if: runner.os != 'Windows'
run: cmake --build build -v
# Build the client and server binaries
# On Windows we need to specify a configuration to avoid a warning about using the default
# debug MSCRT runtime with a lib built with the release MSCRT runtime.
- name: Build rustls-ffi client/server (Windows)
if: matrix.os == 'windows-latest'
if: runner.os == 'Windows'
run: cmake --build build --config Release -v
# Run the rustls-ffi client binary.
- name: Run rustls-ffi client (UNIX)
if: matrix.os != 'windows-latest'
if: runner.os != 'Windows'
env:
RUSTLS_PLATFORM_VERIFIER: 1
run: ./build/tests/client example.com 443 / 1
# Run the rustls-ffi-test binary.
# On Windows it's in a different output location under build.
- name: Run rustls-ffi client (Windows)
if: matrix.os == 'windows-latest'
if: runner.os == 'Windows'
env:
RUSTLS_PLATFORM_VERIFIER: 1
run: .\build\tests\Release\client.exe example.com 443 / 1
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/daily-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
uses: dtolnay/rust-toolchain@nightly

- name: Install cargo-c (Ubuntu)
if: matrix.os == 'ubuntu-latest'
if: runner.os == 'Linux'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz
run: |
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
- name: Install cargo-c (macOS)
if: matrix.os == 'macos-latest'
if: runner.os == 'macOS'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-macos.zip
Expand All @@ -46,7 +46,7 @@ jobs:
unzip cargo-c-macos.zip -d ~/.cargo/bin
- name: Install cargo-c (Windows)
if: matrix.os == 'windows-latest'
if: runner.os == 'Windows'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-windows-msvc.zip
Expand All @@ -57,15 +57,15 @@ jobs:
- name: Setup cmake build
run: |
cmake ${{
matrix.os != 'windows-latest' && '-DCMAKE_BUILD_TYPE=Release \' || ''
runner.os != 'Windows' && '-DCMAKE_BUILD_TYPE=Release \' || ''
}} ${{
matrix.os == 'macos-latest' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || ''
runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || ''
}} -S librustls -B build
- name: Run platform-verifier connect test
run: |
cmake --build build --target connect-test ${{
matrix.os == 'windows-latest' && '--config Release' || ''
runner.os == 'Windows' && '--config Release' || ''
}}
ech:
Expand All @@ -85,15 +85,15 @@ jobs:
uses: dtolnay/rust-toolchain@nightly

- name: Install cargo-c (Ubuntu)
if: matrix.os == 'ubuntu-latest'
if: runner.os == 'Linux'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz
run: |
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
- name: Install cargo-c (macOS)
if: matrix.os == 'macos-latest'
if: runner.os == 'macOS'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-macos.zip
Expand All @@ -102,7 +102,7 @@ jobs:
unzip cargo-c-macos.zip -d ~/.cargo/bin
- name: Install cargo-c (Windows)
if: matrix.os == 'windows-latest'
if: runner.os == 'Windows'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-windows-msvc.zip
Expand All @@ -113,17 +113,17 @@ jobs:
- name: Setup cmake build
run: |
cmake ${{
matrix.os != 'windows-latest' && '-DCMAKE_BUILD_TYPE=Release \' || ''
runner.os != 'Windows' && '-DCMAKE_BUILD_TYPE=Release \' || ''
}} ${{
matrix.os == 'macos-latest' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || ''
runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || ''
}} -S librustls -B build
- name: Run ECH test
# NOTE: uses bash as the shell to allow for easy no-powershell tee/grep pipeline.
shell: bash
run: |
cmake --build build --target ech-test ${{
matrix.os == 'windows-latest' && '--config Release' || ''
runner.os == 'Windows' && '--config Release' || ''
}} | tee ech-test.log
- name: Verify ECH status
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
toolchain: ${{ matrix.rust }}

- name: Install cargo-c (Ubuntu)
if: matrix.os == 'ubuntu-latest'
if: runner.os == 'Linux'
env:
# Version picked for MSRV compat.
LINK: https://github.com/lu-zero/cargo-c/releases/download/v0.10.0
Expand All @@ -93,7 +93,7 @@ jobs:
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
- name: Install cargo-c (macOS)
if: matrix.os == 'macos-latest'
if: runner.os == 'macOS'
env:
# Version picked for MSRV compat.
LINK: https://github.com/lu-zero/cargo-c/releases/download/v0.10.0
Expand All @@ -112,7 +112,7 @@ jobs:
-DPREFER_POST_QUANTUM=${{matrix.prefer-pq}} \
-DDYN_LINK=${{matrix.dyn_link}} \
-DCMAKE_BUILD_TYPE=Debug \
${{ matrix.os == 'macos-latest' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || '' }} \
${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.5' || '' }} \
-S librustls -B build
- name: Build
Expand Down

0 comments on commit 8d1453d

Please sign in to comment.