From bccb80b1154ef4032f4c9055a838eb4a7a2409f3 Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Fri, 3 Jun 2022 13:07:14 -0700 Subject: [PATCH] Refactor check-only and extra-test-args --- .github/workflows/ci.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd1e2236..6f7f51d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,6 +81,8 @@ jobs: - i686-msvc - x86_64-msvc include: + - check_only: false + - extra_test_args: '' - thing: stable target: x86_64-unknown-linux-gnu rust: stable @@ -108,12 +110,18 @@ jobs: - thing: aarch64-ios target: aarch64-apple-ios 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 target: aarch64-apple-ios-sim os: macos-latest + check_only: true - thing: x86_64-ios target: x86_64-apple-ios os: macos-latest + + check_only: true - thing: i686-linux target: i686-unknown-linux-gnu rust: stable @@ -138,10 +146,14 @@ jobs: target: i686-pc-windows-msvc rust: stable-x86_64-msvc 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 target: x86_64-pc-windows-msvc rust: stable-x86_64-msvc os: windows-latest + # CI's Windows doesn't have required root certs + extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring steps: - uses: actions/checkout@v2 @@ -151,6 +163,10 @@ jobs: run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} shell: bash - 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 if: startsWith(matrix.os, 'windows') run: choco install nasm @@ -164,18 +180,12 @@ jobs: - name: Set LIBCLANG_PATH if: startsWith(matrix.os, 'windows') run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV - - if: "startsWith(matrix.os, 'windows') && !contains(matrix.target, 'ios')" - # CI's Windows doesn't have require root certs - run: cargo test --workspace --target ${{ matrix.target }} --exclude tokio-boring --exclude hyper-boring - name: Run tests (Windows) - - 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. + - if: "!matrix.check_only" + run: cargo test --target ${{ matrix.target }} ${{ matrix.extra_test_args }} + name: Run tests + - if: matrix.check_only run: cargo check --target ${{ matrix.target }} --all-targets - name: Check tests (iOS) + name: Check tests - name: Test boring-sys cargo publish # Running `cargo publish --dry-run` tests two things: #