From 303c89df972281c47941db8f46c57d3f0f0a3d61 Mon Sep 17 00:00:00 2001 From: Robin Hundt <24554122+robinhundt@users.noreply.github.com> Date: Tue, 30 Jan 2024 20:05:27 +0100 Subject: [PATCH] CI: Don't test bitpolymul on macos --- .cargo/config.toml | 2 +- .github/workflows/pull_request.yml | 14 +++++++++++++- crates/aligned-vec/src/lib.rs | 4 +++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 416382d..e911c25 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,4 @@ -[target.x86_64-unknown-linux-gnu] +[build] rustflags = ["-C","target-cpu=native"] #[target.x86_64-unknown-linux-gnu] ## needed for flamegraph https://github.com/flamegraph-rs/flamegraph diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ff99801..f0e9c24 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -13,6 +13,14 @@ jobs: runs-on: "${{ matrix.os }}" strategy: matrix: + include: + - os: "ubuntu-latest" + - os: "windows-latest" + exclude: "--exclude 'bitpolymul*'" + features: "aby2,bench-api" + - os: "macos-14" + exclude: "--exclude 'bitpolymul*'" + features: "aby2,bench-api,silent-ot,silent-ot-libote-codes" os: ["ubuntu-latest", "windows-latest", "macos-14"] steps: - name: Check out repository @@ -28,8 +36,12 @@ jobs: run: rustup override set ${{steps.toolchain.outputs.name}} - name: Cache uses: Swatinem/rust-cache@v2 - - name: Test + - name: Run tests + if: ${{ matrix.os == 'ubuntu-latest' }} run: cargo test --workspace --verbose --all-features --no-fail-fast + - name: Run tests + if: ${{ matrix.os != 'ubuntu-latest' }} + run: cargo test --workspace --verbose ${{ matrix.exclude }} --features ${{ matrix.features }} lint: name: Lint runs-on: "ubuntu-latest" diff --git a/crates/aligned-vec/src/lib.rs b/crates/aligned-vec/src/lib.rs index 115d3bb..f692d4d 100644 --- a/crates/aligned-vec/src/lib.rs +++ b/crates/aligned-vec/src/lib.rs @@ -330,7 +330,6 @@ unsafe impl Sync for AlignedVec #[cfg(test)] mod tests { use crate::AlignedVec; - use std::arch::x86_64::{__m128i, _mm_load_si128}; use typenum::U32; #[test] @@ -361,8 +360,11 @@ mod tests { dbg!(av[64]); } + #[cfg(target_arch = "x86_64")] #[test] fn load_si128_from_vec() { + use std::arch::x86_64::{__m128i, _mm_load_si128}; + let av: AlignedVec = (&[42; 2][..]).into(); let bits = unsafe { _mm_load_si128(&av[0] as *const _ as *const __m128i) }; dbg!(bits);