214 lines
6.5 KiB
YAML
214 lines
6.5 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
components: clippy
|
|
override: true
|
|
- uses: actions-rs/clippy-check@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
args: --all-features
|
|
|
|
test-doc:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: nightly
|
|
override: true
|
|
- uses: Swatinem/rust-cache@v1
|
|
- run: cargo install cargo-deadlinks
|
|
- name: doc
|
|
env:
|
|
RUSTDOCFLAGS: --cfg doc_cfg
|
|
run: cargo deadlinks --ignore-fragments -- --all
|
|
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
toolchain: stable
|
|
- os: ubuntu-24.04-arm
|
|
target: aarch64-unknown-linux-gnu
|
|
toolchain: stable
|
|
- os: macos-26-intel
|
|
target: x86_64-apple-darwin
|
|
toolchain: stable
|
|
- os: macos-latest
|
|
target: aarch64-apple-darwin
|
|
toolchain: stable
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-gnu
|
|
toolchain: stable
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
toolchain: beta
|
|
# Test both windows-gnu and windows-msvc; use beta rust on one
|
|
- os: ubuntu-latest
|
|
deps: sudo apt-get update ; sudo apt install gcc-multilib
|
|
target: i686-unknown-linux-gnu
|
|
toolchain: nightly
|
|
- os: macos-latest
|
|
target: aarch64-apple-darwin
|
|
toolchain: nightly
|
|
- os: ubuntu-24.04-arm
|
|
target: aarch64-unknown-linux-gnu
|
|
toolchain: nightly
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
toolchain: nightly
|
|
variant: minimal_versions
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
target: ${{ matrix.target }}
|
|
toolchain: ${{ matrix.toolchain }}
|
|
override: true
|
|
- uses: Swatinem/rust-cache@v1
|
|
- run: ${{ matrix.deps }}
|
|
- name: Maybe minimal versions
|
|
if: ${{ matrix.variant == 'minimal_versions' }}
|
|
run: cargo generate-lockfile -Z minimal-versions
|
|
|
|
- name: Test
|
|
run: |
|
|
cargo test --lib --target ${{ matrix.target }} ${{ matrix.toolchain == 'nightly' && '--features=nightly' || '' }}
|
|
|
|
env:
|
|
# Enables address sanitization if supported target and nightly.
|
|
RUSTFLAGS: |
|
|
${{
|
|
(
|
|
matrix.toolchain == 'nightly' && (
|
|
matrix.target == 'aarch64-apple-darwin' ||
|
|
matrix.target == 'aarch64-fuchsia' ||
|
|
matrix.target == 'aarch64-unknown-linux-gnu' ||
|
|
matrix.target == 'x86_64-apple-darwin' ||
|
|
matrix.target == 'x86_64-fuchsia' ||
|
|
matrix.target == 'x86_64-unknown-freebsd' ||
|
|
matrix.target == 'x86_64-unknown-linux-gnu'
|
|
)
|
|
)
|
|
&& '-Z sanitizer=address'
|
|
|| ''
|
|
}}
|
|
|
|
test-cross:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
target: arm-unknown-linux-gnueabi
|
|
toolchain: stable
|
|
- os: ubuntu-latest
|
|
target: arm-unknown-linux-gnueabi
|
|
toolchain: nightly
|
|
- os: ubuntu-latest
|
|
target: thumbv7neon-unknown-linux-gnueabihf
|
|
toolchain: stable
|
|
- os: ubuntu-latest
|
|
target: thumbv7neon-unknown-linux-gnueabihf
|
|
toolchain: nightly
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
target: ${{ matrix.target }}
|
|
toolchain: ${{ matrix.toolchain }}
|
|
override: true
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
- name: Install cross
|
|
run: cargo install cross || true
|
|
- name: Test
|
|
run: |
|
|
cross test --no-fail-fast --target ${{ matrix.target }} ${{ matrix.toolchain == 'nightly' && '--features=nightly' || '' }}
|
|
|
|
test-msrv:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
target: x86_64-unknown-linux-gnu
|
|
toolchain: 1.36.0 # MSRV
|
|
- uses: Swatinem/rust-cache@v1
|
|
- name: Test
|
|
run: cargo test --target=x86_64-unknown-linux-gnu --no-default-features --features=std
|
|
|
|
test-no-std:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: nightly
|
|
target: thumbv6m-none-eabi
|
|
override: true
|
|
- uses: Swatinem/rust-cache@v1
|
|
- name: Build top-level only
|
|
run: cargo build --target=thumbv6m-none-eabi --no-default-features
|
|
|
|
test-miri:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: nightly
|
|
override: true
|
|
- uses: Swatinem/rust-cache@v1
|
|
- name: Install Miri
|
|
run: |
|
|
rustup toolchain install nightly --component miri
|
|
rustup override set nightly
|
|
cargo miri setup
|
|
- name: Run scalar tests under miri
|
|
run: cargo +nightly miri test scalar
|
|
- name: Run sse2 tests under miri
|
|
run: cargo +nightly miri test sse2
|
|
- name: Run ssse3 tests under miri
|
|
run: cargo +nightly miri test --lib ssse3
|
|
env:
|
|
RUSTFLAGS: "-Ctarget-cpu=x86-64-v2"
|
|
- name: Run avx2 tests under miri
|
|
run: cargo +nightly miri test --lib avx2
|
|
env:
|
|
RUSTFLAGS: "-Ctarget-cpu=x86-64-v3"
|
|
- name: Run avx512 tests under miri
|
|
run: cargo +nightly miri test --lib --features=nightly avx512
|
|
env:
|
|
RUSTFLAGS: "-Ctarget-cpu=x86-64-v4"
|