1name: CI23on:4 pull_request:5 push:6 branches:7 - master89env:10 CARGO_NET_RETRY: 1011 RUSTUP_MAX_RETRIES: 1012 PROPTEST_CASES: 641314jobs:15 rustfmt:16 name: "rustfmt"17 runs-on: ubuntu-latest1819 steps:20 - uses: actions/checkout@v421 - name: Run rustfmt22 run: cargo fmt --all -- --check2324 clippy:25 name: "clippy on ${{ matrix.target }}"26 runs-on: ubuntu-latest27 strategy:28 fail-fast: false29 matrix:30 target:31 # We shouldn't really have any OS-specific code, so think of this as a list of architectures32 - x86_64-unknown-linux-gnu33 - i686-unknown-linux-gnu34 - i586-unknown-linux-gnu35 - aarch64-unknown-linux-gnu36 - arm64ec-pc-windows-msvc37 - armv7-unknown-linux-gnueabihf38 - loongarch64-unknown-linux-gnu39 # non-nightly since https://github.com/rust-lang/rust/pull/11327440 # - mips-unknown-linux-gnu41 # - mips64-unknown-linux-gnuabi6442 - powerpc-unknown-linux-gnu43 - powerpc64-unknown-linux-gnu44 - riscv64gc-unknown-linux-gnu45 - s390x-unknown-linux-gnu46 - sparc64-unknown-linux-gnu47 - wasm32-unknown-unknown4849 steps:50 - uses: actions/checkout@v451 - name: Setup Rust52 run: rustup target add ${{ matrix.target }}53 - name: Run Clippy54 run: cargo clippy --all-targets --target ${{ matrix.target }}5556 x86-tests:57 name: "${{ matrix.target_feature }} on ${{ matrix.target }}"58 runs-on: ${{ matrix.os }}59 strategy:60 fail-fast: false61 matrix:62 target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc, x86_64-unknown-linux-gnu]63 # `default` means we use the default target config for the target,64 # `native` means we run with `-Ctarget-cpu=native`, and anything else is65 # an arg to `-Ctarget-feature`66 target_feature: [default, native, +sse3, +ssse3, +sse4.1, +sse4.2, +avx, +avx2]6768 exclude:69 # -Ctarget-cpu=native sounds like bad-news if target != host70 - { target: i686-pc-windows-msvc, target_feature: native }7172 include:73 # Populate the `matrix.os` field74 - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }75 - { target: x86_64-pc-windows-msvc, os: windows-latest }76 - { target: i686-pc-windows-msvc, os: windows-latest }7778 # Annoyingly, the x86_64-unknown-linux-gnu runner *almost* always has79 # avx512vl, but occasionally doesn't. Maybe one day we can enable it.8081 steps:82 - uses: actions/checkout@v483 - name: Setup Rust84 run: rustup target add ${{ matrix.target }}8586 - name: Configure RUSTFLAGS87 shell: bash88 run: |89 case "${{ matrix.target_feature }}" in90 default)91 echo "RUSTFLAGS=-Dwarnings" >> $GITHUB_ENV;;92 native)93 echo "RUSTFLAGS=-Dwarnings -Ctarget-cpu=native" >> $GITHUB_ENV94 ;;95 *)96 echo "RUSTFLAGS=-Dwarnings -Ctarget-feature=${{ matrix.target_feature }}" >> $GITHUB_ENV97 ;;98 esac99100 # Super useful for debugging why a SIGILL occurred.101 - name: Dump target configuration and support102 run: |103 rustc -Vv104105 echo "Caveat: not all target features are expected to be logged"106107 echo "## Requested target configuration (RUSTFLAGS=$RUSTFLAGS)"108 rustc --print=cfg --target=${{ matrix.target }} $RUSTFLAGS109110 echo "## Supported target configuration for --target=${{ matrix.target }}"111 rustc --print=cfg --target=${{ matrix.target }} -Ctarget-cpu=native112113 echo "## Natively supported target configuration"114 rustc --print=cfg -Ctarget-cpu=native115116 - name: Test (debug)117 run: cargo test --verbose --target=${{ matrix.target }}118119 - name: Test (release)120 run: cargo test --verbose --target=${{ matrix.target }} --release121122 - name: Generate docs123 run: cargo doc --verbose --target=${{ matrix.target }}124 env:125 RUSTDOCFLAGS: -Dwarnings126127 macos-tests:128 name: ${{ matrix.target }}129 runs-on: macos-latest130 strategy:131 fail-fast: false132 matrix:133 target:134 - aarch64-apple-darwin135 - x86_64-apple-darwin136 steps:137 - uses: actions/checkout@v4138 - name: Setup Rust139 run: rustup target add ${{ matrix.target }}140141 - name: Configure RUSTFLAGS142 shell: bash143 run: echo "RUSTFLAGS=-Dwarnings" >> $GITHUB_ENV144145 - name: Test (debug)146 run: cargo test --verbose --target=${{ matrix.target }}147148 - name: Test (release)149 run: cargo test --verbose --target=${{ matrix.target }} --release150151 - name: Generate docs152 run: cargo doc --verbose --target=${{ matrix.target }}153 env:154 RUSTDOCFLAGS: -Dwarnings155156 wasm-tests:157 name: "wasm (firefox, ${{ matrix.name }})"158 runs-on: ubuntu-latest159 strategy:160 matrix:161 include:162 - { name: default, RUSTFLAGS: "" }163 - { name: simd128, RUSTFLAGS: "-C target-feature=+simd128" }164 steps:165 - uses: actions/checkout@v4166 - name: Install wasm-pack167 run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh168 - name: Test (debug)169 run: wasm-pack test --firefox --headless crates/core_simd170 env:171 RUSTFLAGS: ${{ matrix.rustflags }}172 - name: Test (release)173 run: wasm-pack test --firefox --headless crates/core_simd --release174 env:175 RUSTFLAGS: ${{ matrix.rustflags }}176177 cross-tests:178 name: "${{ matrix.target_feature }} on ${{ matrix.target }} (via cross)"179 runs-on: ubuntu-latest180 env:181 PROPTEST_CASES: 16182 strategy:183 fail-fast: false184185 matrix:186 target:187 - armv7-unknown-linux-gnueabihf188 - thumbv7neon-unknown-linux-gnueabihf # includes neon by default189 - aarch64-unknown-linux-gnu # includes neon by default190 - powerpc-unknown-linux-gnu191 - powerpc64le-unknown-linux-gnu # includes altivec by default192 - riscv64gc-unknown-linux-gnu193 - loongarch64-unknown-linux-gnu194 # MIPS uses a nonstandard binary representation for NaNs which makes it worth testing195 # non-nightly since https://github.com/rust-lang/rust/pull/113274196 # - mips-unknown-linux-gnu197 # - mips64-unknown-linux-gnuabi64198 # Lots of errors in QEMU and no real hardware to test on. Not clear if it's QEMU or bad codegen.199 # - powerpc64-unknown-linux-gnu200 target_feature: [default]201 include:202 - { target: powerpc64le-unknown-linux-gnu, target_feature: "+vsx" }203 # Fails due to QEMU floating point errors, probably handling subnormals incorrectly.204 # This target is somewhat redundant, since ppc64le has altivec as well.205 # - { target: powerpc-unknown-linux-gnu, target_feature: "+altivec" }206 # We should test this, but cross currently can't run it207 # - { target: riscv64gc-unknown-linux-gnu, target_feature: "+v,+zvl128b" }208209 steps:210 - uses: actions/checkout@v4211 - name: Setup Rust212 run: rustup target add ${{ matrix.target }}213214 - name: Install Cross215 # Install the latest git version for newer targets.216 run: |217 cargo install cross --git https://github.com/cross-rs/cross --rev 4090beca3cfffa44371a5bba524de3a578aa46c3218219 - name: Configure Emulated CPUs220 run: |221 echo "CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER=qemu-ppc -cpu e600" >> $GITHUB_ENV222 # echo "CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_RUNNER=qemu-riscv64 -cpu rv64,zba=true,zbb=true,v=true,vlen=256,vext_spec=v1.0" >> $GITHUB_ENV223224 - name: Configure RUSTFLAGS225 shell: bash226 run: |227 case "${{ matrix.target_feature }}" in228 default)229 echo "RUSTFLAGS=" >> $GITHUB_ENV;;230 *)231 echo "RUSTFLAGS=-Ctarget-feature=${{ matrix.target_feature }}" >> $GITHUB_ENV232 ;;233 esac234235 - name: Test (debug)236 run: cross test --verbose --target=${{ matrix.target }}237238 - name: Test (release)239 run: cross test --verbose --target=${{ matrix.target }} --release240241 miri:242 runs-on: ubuntu-latest243 strategy:244 fail-fast: false245 matrix:246 shard: [1, 2, 3, 4]247 env:248 PROPTEST_CASES: 16249 steps:250 - uses: actions/checkout@v4251252 - name: Install cargo-nextest253 uses: taiki-e/install-action@nextest254255 - name: Test (Miri) (partition ${{ matrix.shard }}/4)256 run: |257 cargo miri nextest run --partition count:${{ matrix.shard }}/4
Findings
✓ No findings reported for this file.