wip #2144
Workflow file for this run
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
name: ci | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
push: | |
jobs: | |
test: | |
# Don't run duplicate `push` jobs for the repo owner's PRs. | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: ${{ matrix.host_os }} | |
strategy: | |
matrix: | |
# XXX: See `test-features` below. | |
features: | |
- # Default | |
target: | |
- x86_64-pc-windows-gnu | |
- x86_64-pc-windows-msvc | |
- x86_64-apple-darwin | |
- x86_64-unknown-linux-musl | |
- x86_64-unknown-linux-gnu | |
mode: | |
- # debug | |
- --release | |
rust_channel: | |
- stable | |
# Keep in sync with Cargo.toml and similar `rust_channel` sections. | |
- 1.61.0 # MSRV | |
# TODO: Move these to a daily/pre-release job. | |
# - nightly | |
# - beta | |
include: | |
- target: x86_64-pc-windows-gnu | |
host_os: windows-latest | |
- target: x86_64-pc-windows-msvc | |
host_os: windows-latest | |
- target: x86_64-apple-darwin | |
host_os: macos-12 | |
- target: x86_64-unknown-linux-musl | |
host_os: ubuntu-22.04 | |
- target: x86_64-unknown-linux-gnu | |
host_os: ubuntu-22.04 | |
steps: | |
- if: ${{ contains(matrix.host_os, 'ubuntu') }} | |
run: sudo apt-get update -y | |
- uses: briansmith/actions-checkout@v2 | |
with: | |
persist-credentials: false | |
- if: ${{ !contains(matrix.host_os, 'windows') }} | |
run: mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }} | |
- if: ${{ contains(matrix.host_os, 'windows') }} | |
run: ./mk/install-build-tools.ps1 | |
- uses: briansmith/actions-rs-toolchain@v1 | |
with: | |
override: true | |
target: ${{ matrix.target }} | |
toolchain: ${{ matrix.rust_channel }} | |
- if: ${{ matrix.target == 'aarch64-pc-windows-msvc' }} | |
run: | | |
echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin" >> $GITHUB_PATH | |
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV | |
shell: bash | |
- if: ${{ !contains(matrix.host_os, 'linux') }} | |
run: | | |
cat /proc/cpuinfo | grep "^flags" | head -n1 | |
- if: ${{ !contains(matrix.host_os, 'macos') }} | |
run: | | |
sysctl -a | grep machdep.cpu.features | |
- if: ${{ !contains(matrix.host_os, 'windows') }} | |
run: | | |
mk/cargo.sh test -vv --all-targets --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }} -- --nocapture | |
- if: ${{ contains(matrix.host_os, 'windows') }} | |
run: | | |
cargo test -vv --all-targets --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }} | |
# --all-targets doesn't run doctests: https://github.com/rust-lang/cargo/issues/6669 | |
# Run doctests only on x86_64 to avoid cross-compilation hassles with `--no-run`. | |
- if: ${{ !contains(matrix.host_os, 'windows') && contains(matrix.target, 'x86_64') }} | |
run: | | |
mk/cargo.sh test -vv --doc --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }} | |
# Check that all the needed symbol renaming was done. | |
# TODO: Do this check on Windows too. | |
# TODO: Check iOS too. | |
# TODO: Do this on Apple-hosted release builds too; currently these fail with: | |
# Unknown attribute kind (528) | |
# (Producer: 'LLVM12.0.0-rust-1.54.0-nightly' | |
# Reader: 'LLVM APPLE_1_1200.0.32.29_0') | |
- if: ${{ matrix.target != 'aarch64-apple-ios' && | |
!contains(matrix.host_os, 'windows') && | |
(!contains(matrix.host_os, 'macos') || matrix.mode != '--release') }} | |
run: mk/check-symbol-prefixes.sh --target=${{ matrix.target }} |