Skip to content

Wip

Wip #3855

Workflow file for this run

name: ci
permissions:
contents: read
on:
pull_request:
push:
jobs:
rustfmt:
# 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: ubuntu-22.04
steps:
- run: rustup --version
- uses: briansmith/actions-checkout@v4
with:
persist-credentials: false
- run: cargo fmt --all -- --check
clippy:
# 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: ubuntu-22.04
steps:
- run: rustup --version
- uses: briansmith/actions-checkout@v4
with:
persist-credentials: false
- run: mk/clippy.sh
audit:
# 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: ubuntu-22.04
steps:
- run: rustup --version
- uses: briansmith/actions-cache@v3
with:
path: |
~/.cargo/bin/cargo-audit
~/.cargo/.crates.toml
~/.cargo/.crates2.json
key: ${{ runner.os }}-v2-cargo-audit-locked-0.18.3
- run: cargo install cargo-audit --locked --vers "0.18.3"
- uses: briansmith/actions-checkout@v4
with:
persist-credentials: false
- run: cargo generate-lockfile
- run: cargo audit --deny warnings
cargo-semver-checks:
runs-on: ubuntu-22.04
steps:
- run: rustup --version
- uses: briansmith/actions-cache@v3
with:
path: |
~/.cargo/bin/cargo-semver-checks
~/.cargo/.crates.toml
~/.cargo/.crates2.json
key: ${{ runner.os }}-v2-cargo-audit-locked-0.18.3
- run: cargo install cargo-semver-checks --locked --vers "0.31.0"
- uses: briansmith/actions-checkout@v4
with:
persist-credentials: false
- run: cargo semver-checks
deny:
# 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: ubuntu-22.04
steps:
- run: rustup --version
- uses: briansmith/actions-cache@v3
with:
path: |
~/.cargo/bin/cargo-deny
~/.cargo/.crates.toml
~/.cargo/.crates2.json
key: ${{ runner.os }}-v2-cargo-deny-locked-0.14.20
- run: cargo install cargo-deny --locked --vers "0.14.20"
- uses: briansmith/actions-checkout@v4
with:
persist-credentials: false
- run: cargo deny check
# Verify that documentation builds.
rustdoc:
# 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: ubuntu-22.04
steps:
- run: rustup --version
- uses: briansmith/actions-checkout@v4
with:
persist-credentials: false
- run: |
cargo doc --all-features
package:
# 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: windows-latest
steps:
- run: rustup --version
- uses: briansmith/actions-checkout@v4
with:
persist-credentials: false
- run: ./mk/install-build-tools.ps1
- run: echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin" >> $GITHUB_PATH
shell: bash
- run: sh mk/package.sh
shell: bash
# Intentionally excludes benchmarks for build performance reasons.
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 }}
env:
CC_ENABLE_DEBUG_OUTPUT: 1
strategy:
matrix:
# XXX: See `test-features` below.
features:
- # Default
mode:
- # debug
- --release
rust_channel:
- stable
# Keep in sync with Cargo.toml and similar `rust_channel` sections.
- 1.63.0 # MSRV
# TODO: Move these to a daily/pre-release job.
# - nightly
# - beta
include:
- target: aarch64-apple-darwin
host_os: macos-14
- target: aarch64-apple-ios
host_os: macos-14
# TODO: Run in the emulator.
cargo_options: --no-run
- target: aarch64-apple-tvos
host_os: macos-14
rust_channel: nightly
mode: --release
# TODO: Run in the emulator.
cargo_options: --no-run -Z build-std
- target: aarch64-apple-visionos
host_os: macos-14
rust_channel: nightly
mode: --release
xcode_version: 15.2
# TODO: Run in the emulator.
cargo_options: --no-run -Z build-std
- target: aarch64-apple-watchos
host_os: macos-14
rust_channel: nightly
mode: --release
# TODO: Run in the emulator.
cargo_options: --no-run -Z build-std
- target: aarch64-linux-android
host_os: ubuntu-22.04
# TODO: https://github.com/briansmith/ring/issues/486
cargo_options: --no-run
- target: aarch64-pc-windows-msvc
host_os: windows-latest
# GitHub Actions doesn't have a way to run this target yet.
cargo_options: --no-run
- target: aarch64-unknown-linux-gnu
host_os: ubuntu-22.04
- target: aarch64-unknown-linux-musl
host_os: ubuntu-22.04
- target: arm-unknown-linux-gnueabi
host_os: ubuntu-22.04
- target: armv7-linux-androideabi
host_os: ubuntu-22.04
# TODO: https://github.com/briansmith/ring/issues/838
cargo_options: --no-run
- target: armv7-unknown-linux-musleabihf
host_os: ubuntu-22.04
- target: i686-pc-windows-msvc
host_os: windows-latest
- target: i686-unknown-linux-gnu
host_os: ubuntu-22.04
- target: i686-unknown-linux-musl
host_os: ubuntu-22.04
- target: mips-unknown-linux-gnu
mode: --release
rust_channel: 1.71.0 # No prebuilt toolchain for later versions.
host_os: ubuntu-22.04
- target: mips64el-unknown-linux-gnuabi64
mode: --release
rust_channel: 1.71.0 # No prebuilt toolchain for later versions.
host_os: ubuntu-22.04
- target: mipsel-unknown-linux-gnu
mode: --release
rust_channel: 1.71.0 # No prebuilt toolchain for later versions.
host_os: ubuntu-22.04
- target: powerpc-unknown-linux-gnu
mode: --release
rust_channel: stable
host_os: ubuntu-22.04
- target: powerpc64-unknown-linux-gnu
mode: --release
rust_channel: stable
host_os: ubuntu-22.04
- target: powerpc64le-unknown-linux-gnu
mode: --release
rust_channel: stable
host_os: ubuntu-22.04
- target: riscv64gc-unknown-linux-gnu
host_os: ubuntu-22.04
- target: s390x-unknown-linux-gnu
mode: --release
rust_channel: stable
host_os: ubuntu-22.04
- target: wasm32-wasi
host_os: ubuntu-22.04
- 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-13
- 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@v4
with:
persist-credentials: false
- run: mk/install-build-tools.sh +${{ matrix.rust_channel }} --target=${{ matrix.target }}
shell: sh
- if: ${{ contains(matrix.host_os, 'windows') }}
run: ./mk/install-build-tools.ps1
- 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
shell: bash
- if: ${{ matrix.xcode_version != '' }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version }}.app
- if: ${{ !contains(matrix.host_os, 'windows') }}
run: |
mk/cargo.sh +${{ matrix.rust_channel }} test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
- if: ${{ contains(matrix.host_os, 'windows') }}
run: |
cargo +${{ matrix.rust_channel }} test -vv --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.
- if: ${{ (matrix.target != 'aarch64-apple-ios' || matrix.rust_channel != '1.63.0') &&
!contains(matrix.host_os, 'windows') }}
run: rustup toolchain install --component=llvm-tools-preview ${{ matrix.rust_channel }}
- if: ${{ (matrix.target != 'aarch64-apple-ios' || matrix.rust_channel != '1.63.0') &&
!contains(matrix.host_os, 'windows') }}
run: mk/check-symbol-prefixes.sh +${{ matrix.rust_channel }} --target=${{ matrix.target }}