Add rustc folder to dynamic linker search path #3887
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [main, auto, canary] | |
pull_request: | |
branches: | |
- main | |
name: CI | |
env: | |
RUSTFLAGS: -D warnings | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2 | |
- name: Lint (clippy) | |
run: cargo clippy --all-features --all-targets | |
- name: Lint (rustfmt) | |
run: cargo xfmt --check | |
- name: Install cargo readme | |
uses: taiki-e/install-action@33429073072b7cebf2bbb9807209561b3d1decf7 # v2 | |
with: | |
tool: cargo-readme | |
- name: Run cargo readme | |
run: ./scripts/regenerate-readmes.sh | |
- name: Check for differences | |
run: git diff --exit-code | |
build-rustdoc: | |
name: Build documentation | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2 | |
- name: Build rustdoc | |
run: cargo doc --all-features --workspace | |
build: | |
name: Build and test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
# macos-14 for M1 runners | |
- macos-14 | |
- windows-latest | |
# 1.74 is the MSRV | |
rust-version: ["1.74", stable] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust-version }} | |
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2 | |
with: | |
# Matrix instances (other than OS) need to be added to this explicitly | |
key: ${{ matrix.rust-version }} | |
- name: Install latest nextest release | |
uses: taiki-e/install-action@nextest | |
- name: Build nextest-metadata | |
run: cargo build --package nextest-metadata | |
- name: Build cargo-nextest without self-update | |
run: cargo build --package cargo-nextest --no-default-features --features default-no-update | |
- name: Build cargo-nextest | |
run: cargo build --package cargo-nextest | |
- name: Build all targets | |
run: cargo build --all-targets | |
- name: Build all targets with all features | |
run: cargo build --all-targets --all-features | |
- name: Doctests | |
run: cargo test --doc | |
- name: Test with locally built nextest | |
run: cargo local-nt run --profile ci | |
- name: Test with latest nextest release | |
run: cargo nextest run --profile ci | |
- name: Test without double-spawning | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-14' }} | |
env: | |
NEXTEST_DOUBLE_SPAWN: 0 | |
run: cargo local-nt run --profile ci | |
test-archive-target-runner: | |
name: Test archives with a target runner | |
# gcc-mingw-w64-x86-64-win32 requires Ubuntu 22.04 | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
targets: x86_64-pc-windows-gnu | |
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2 | |
# The version of wine that comes with Ubuntu 22.04 is too old: it doesn't contain | |
# bcryptprimitives.dll, which is required to run binaries built with Rust 1.78+. We use the | |
# WineHQ PPA to get a newer version. | |
- name: Add Wine PPA | |
run: | | |
sudo dpkg --add-architecture i386 | |
wget -nc https://dl.winehq.org/wine-builds/winehq.key | |
sudo apt-key add winehq.key | |
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ jammy main' | |
- name: Install wine and gcc-mingw-w64-x86-64-win32 | |
run: | | |
sudo apt-get update | |
sudo apt-get install winehq-stable gcc-mingw-w64-x86-64-win32 | |
- name: Build cargo-nextest | |
run: cargo build --package cargo-nextest | |
- name: Archive test fixtures | |
run: | | |
cargo local-nt archive --manifest-path fixtures/nextest-tests/Cargo.toml \ | |
--target x86_64-pc-windows-gnu --archive-file target/fixture-archive.tar.zst \ | |
--package cdylib-example --package nextest-derive | |
- name: Run test fixtures | |
env: | |
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER: wine | |
run: cargo local-nt run --archive-file target/fixture-archive.tar.zst |