| 1 |
name: CI |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
pull_request: |
| 6 |
workflow_dispatch: |
| 7 |
schedule: [cron: "40 1 * * *"] |
| 8 |
|
| 9 |
permissions: |
| 10 |
contents: read |
| 11 |
|
| 12 |
env: |
| 13 |
RUSTFLAGS: -Dwarnings |
| 14 |
|
| 15 |
jobs: |
| 16 |
pre_ci: |
| 17 |
uses: dtolnay/.github/.github/workflows/pre_ci.yml@master |
| 18 |
|
| 19 |
test: |
| 20 |
name: ${{matrix.os == 'macos' && 'macOS' || format('Rust {0} ({1})', matrix.rust, matrix.arch)}} |
| 21 |
needs: pre_ci |
| 22 |
if: needs.pre_ci.outputs.continue |
| 23 |
runs-on: ${{matrix.os == 'macos' && 'macos-latest' || matrix.arch == 'x86_64' && 'ubuntu-latest' || 'ubuntu-24.04-arm'}} |
| 24 |
strategy: |
| 25 |
fail-fast: false |
| 26 |
matrix: |
| 27 |
rust: [nightly, beta, stable, 1.86.0, 1.71.0] |
| 28 |
arch: [x86_64, aarch64] |
| 29 |
os: [ubuntu] |
| 30 |
include: |
| 31 |
- rust: nightly |
| 32 |
os: macos |
| 33 |
timeout-minutes: 45 |
| 34 |
steps: |
| 35 |
- uses: actions/checkout@v7 |
| 36 |
- uses: dtolnay/rust-toolchain@master |
| 37 |
with: |
| 38 |
toolchain: ${{matrix.rust}} |
| 39 |
targets: wasm32-unknown-unknown |
| 40 |
- name: Enable type layout randomization |
| 41 |
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV |
| 42 |
if: matrix.rust == 'nightly' |
| 43 |
- run: cargo check |
| 44 |
- run: cargo build --tests --features no-panic --release |
| 45 |
if: matrix.rust == 'nightly' |
| 46 |
- run: cargo test |
| 47 |
if: matrix.rust != '1.71.0' |
| 48 |
- run: cargo test --release |
| 49 |
if: matrix.rust != '1.71.0' |
| 50 |
- run: cargo check --target=wasm32-unknown-unknown |
| 51 |
- run: cargo check |
| 52 |
env: |
| 53 |
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native |
| 54 |
- run: cargo build --tests --features no-panic --release |
| 55 |
if: matrix.rust == 'nightly' |
| 56 |
env: |
| 57 |
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native |
| 58 |
- run: cargo test |
| 59 |
if: matrix.rust != '1.71.0' |
| 60 |
env: |
| 61 |
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native |
| 62 |
- run: cargo test --release |
| 63 |
if: matrix.rust != '1.71.0' |
| 64 |
env: |
| 65 |
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native |
| 66 |
- run: cargo --config='profile.dev.opt-level="s"' check |
| 67 |
- run: cargo --config='profile.release.opt-level="s"' build --tests --features no-panic --release |
| 68 |
if: matrix.rust == 'nightly' |
| 69 |
- run: cargo --config='profile.dev.opt-level="s"' test |
| 70 |
if: matrix.rust != '1.71.0' |
| 71 |
- run: cargo --config='profile.release.opt-level="s"' test --release |
| 72 |
if: matrix.rust != '1.71.0' |
| 73 |
- run: cargo --config='profile.release.opt-level="s"' check --target=wasm32-unknown-unknown |
| 74 |
- uses: actions/upload-artifact@v7 |
| 75 |
if: matrix.rust == 'nightly' && matrix.arch == 'x86_64' && matrix.os == 'ubuntu' && always() |
| 76 |
with: |
| 77 |
name: Cargo.lock |
| 78 |
path: Cargo.lock |
| 79 |
continue-on-error: true |
| 80 |
|
| 81 |
doc: |
| 82 |
name: Documentation |
| 83 |
needs: pre_ci |
| 84 |
if: needs.pre_ci.outputs.continue |
| 85 |
runs-on: ubuntu-latest |
| 86 |
env: |
| 87 |
RUSTDOCFLAGS: -Dwarnings |
| 88 |
timeout-minutes: 45 |
| 89 |
steps: |
| 90 |
- uses: actions/checkout@v7 |
| 91 |
- uses: dtolnay/rust-toolchain@nightly |
| 92 |
- uses: dtolnay/install@cargo-docs-rs |
| 93 |
- run: cargo docs-rs |
| 94 |
|
| 95 |
clippy: |
| 96 |
name: Clippy |
| 97 |
runs-on: ubuntu-latest |
| 98 |
if: github.event_name != 'pull_request' |
| 99 |
timeout-minutes: 45 |
| 100 |
steps: |
| 101 |
- uses: actions/checkout@v7 |
| 102 |
- uses: dtolnay/rust-toolchain@clippy |
| 103 |
with: |
| 104 |
targets: aarch64-unknown-linux-gnu |
| 105 |
- run: cargo clippy --tests --benches -- -Dclippy::all -Dclippy::pedantic |
| 106 |
- run: cargo clippy --target=aarch64-unknown-linux-gnu -- -Dclippy::all -Dclippy::pedantic |
| 107 |
- run: cargo clippy -- -Dclippy::all -Dclippy::pedantic |
| 108 |
env: |
| 109 |
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native |
| 110 |
|
| 111 |
miri: |
| 112 |
name: Miri (${{matrix.name}}) |
| 113 |
needs: pre_ci |
| 114 |
if: needs.pre_ci.outputs.continue |
| 115 |
runs-on: ubuntu-latest |
| 116 |
strategy: |
| 117 |
fail-fast: false |
| 118 |
matrix: |
| 119 |
include: |
| 120 |
- name: 64-bit little endian |
| 121 |
target: x86_64-unknown-linux-gnu |
| 122 |
- name: 64-bit little endian, NEON |
| 123 |
target: aarch64-unknown-linux-gnu |
| 124 |
- name: 64-bit big endian |
| 125 |
target: powerpc64-unknown-linux-gnu |
| 126 |
- name: 32-bit little endian |
| 127 |
target: i686-unknown-linux-gnu |
| 128 |
- name: 32-bit big endian |
| 129 |
target: mips-unknown-linux-gnu |
| 130 |
timeout-minutes: 45 |
| 131 |
steps: |
| 132 |
- uses: actions/checkout@v7 |
| 133 |
- uses: dtolnay/rust-toolchain@miri |
| 134 |
- run: cargo miri setup |
| 135 |
- run: cargo miri test --target ${{matrix.target}} |
| 136 |
env: |
| 137 |
MIRIFLAGS: -Zmiri-strict-provenance |
| 138 |
|
| 139 |
outdated: |
| 140 |
name: Outdated |
| 141 |
runs-on: ubuntu-latest |
| 142 |
if: github.event_name != 'pull_request' |
| 143 |
timeout-minutes: 45 |
| 144 |
steps: |
| 145 |
- uses: actions/checkout@v7 |
| 146 |
- uses: dtolnay/rust-toolchain@stable |
| 147 |
- uses: dtolnay/install@cargo-outdated |
| 148 |
- run: cargo outdated --exit-code 1 |
| 149 |
- run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1 |
| 150 |
|
| 151 |
fuzz: |
| 152 |
name: Fuzz |
| 153 |
needs: pre_ci |
| 154 |
if: needs.pre_ci.outputs.continue |
| 155 |
runs-on: ubuntu-latest |
| 156 |
timeout-minutes: 45 |
| 157 |
steps: |
| 158 |
- uses: actions/checkout@v7 |
| 159 |
- uses: dtolnay/rust-toolchain@nightly |
| 160 |
- uses: dtolnay/install@cargo-fuzz |
| 161 |
- run: cargo fuzz check |