Refactor check-only and extra-test-args

This commit is contained in:
Chris Eager 2022-06-03 13:07:14 -07:00 committed by Anthony Ramine
parent bbe8cd1b9e
commit bccb80b115
1 changed files with 21 additions and 11 deletions

View File

@ -81,6 +81,8 @@ jobs:
- i686-msvc - i686-msvc
- x86_64-msvc - x86_64-msvc
include: include:
- check_only: false
- extra_test_args: ''
- thing: stable - thing: stable
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
rust: stable rust: stable
@ -108,12 +110,18 @@ jobs:
- thing: aarch64-ios - thing: aarch64-ios
target: aarch64-apple-ios target: aarch64-apple-ios
os: macos-latest os: macos-latest
check_only: true
# It's... theoretically possible to run tests on iPhone Simulator,
# but for now, make sure that BoringSSL only builds.
- thing: aarch64-ios-sim - thing: aarch64-ios-sim
target: aarch64-apple-ios-sim target: aarch64-apple-ios-sim
os: macos-latest os: macos-latest
check_only: true
- thing: x86_64-ios - thing: x86_64-ios
target: x86_64-apple-ios target: x86_64-apple-ios
os: macos-latest os: macos-latest
check_only: true
- thing: i686-linux - thing: i686-linux
target: i686-unknown-linux-gnu target: i686-unknown-linux-gnu
rust: stable rust: stable
@ -138,10 +146,14 @@ jobs:
target: i686-pc-windows-msvc target: i686-pc-windows-msvc
rust: stable-x86_64-msvc rust: stable-x86_64-msvc
os: windows-latest os: windows-latest
# CI's Windows doesn't have required root certs
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring
- thing: x86_64-msvc - thing: x86_64-msvc
target: x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc
rust: stable-x86_64-msvc rust: stable-x86_64-msvc
os: windows-latest os: windows-latest
# CI's Windows doesn't have required root certs
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -151,6 +163,10 @@ jobs:
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
shell: bash shell: bash
- run: rustup target add ${{ matrix.target }} - run: rustup target add ${{ matrix.target }}
- name: Install Linux cross-compile dependencies
if: "contains(matrix.target, 'linux') && !startsWith(matrix.target, 'x86_64')"
run: sudo apt install -y gcc-multilib g++-multilib
shell: bash
- name: Install nasm - name: Install nasm
if: startsWith(matrix.os, 'windows') if: startsWith(matrix.os, 'windows')
run: choco install nasm run: choco install nasm
@ -164,18 +180,12 @@ jobs:
- name: Set LIBCLANG_PATH - name: Set LIBCLANG_PATH
if: startsWith(matrix.os, 'windows') if: startsWith(matrix.os, 'windows')
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
- if: "startsWith(matrix.os, 'windows') && !contains(matrix.target, 'ios')" - if: "!matrix.check_only"
# CI's Windows doesn't have require root certs run: cargo test --target ${{ matrix.target }} ${{ matrix.extra_test_args }}
run: cargo test --workspace --target ${{ matrix.target }} --exclude tokio-boring --exclude hyper-boring name: Run tests
name: Run tests (Windows) - if: matrix.check_only
- if: "!startsWith(matrix.os, 'windows') && !contains(matrix.target, 'ios')"
run: cargo test --target ${{ matrix.target }}
name: Run tests (not Windows)
- if: "contains(matrix.target, 'ios')"
# It's... theoretically possible to run tests on iPhone Simulator,
# but for now, make sure that BoringSSL only builds.
run: cargo check --target ${{ matrix.target }} --all-targets run: cargo check --target ${{ matrix.target }} --all-targets
name: Check tests (iOS) name: Check tests
- name: Test boring-sys cargo publish - name: Test boring-sys cargo publish
# Running `cargo publish --dry-run` tests two things: # Running `cargo publish --dry-run` tests two things:
# #