Files
concrete/.github/workflows/concrete_cpu_test.yml

96 lines
2.3 KiB
YAML

name: Concrete CPU - Tests
on:
workflow_call:
workflow_dispatch:
concurrency:
group: concrete_cpu_test-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
CARGO_TERM_COLOR: always
jobs:
tests-linux:
runs-on: ubuntu-20.04
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- name: Rust install
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-01-31
override: true
components: rustfmt, clippy
- name: Download cargo cache
uses: Swatinem/rust-cache@v2
- name: Formatting
run: |
cd backends/concrete-cpu/implementation
cargo fmt --check
- name: Remove header to force regeneration
run: |
cd backends/concrete-cpu/implementation
rm include/concrete-cpu.h
- name: Build
run: |
cd backends/concrete-cpu/implementation
cargo build --all-targets
- name: Check regenerated header is unchanged
run: |
cd backends/concrete-cpu/implementation
git diff --exit-code
- name: Lint
run: |
cd backends/concrete-cpu/implementation
cargo +stable clippy --all-targets
- name: Tests
run: |
cd backends/concrete-cpu/implementation
cargo test --no-fail-fast --all-targets --features=nightly
tests-mac_x86:
runs-on: macos-11
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- name: Setup rust toolchain for concrete-cpu
uses: ./.github/workflows/setup_rust_toolchain_for_concrete_cpu
- name: Download cargo cache
uses: Swatinem/rust-cache@v2
- name: Tests
run: |
cd backends/concrete-cpu/implementation
cargo test --no-fail-fast --all-targets
tests-mac-m1:
runs-on: "aws-mac2-metal"
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- name: Setup rust toolchain for concrete-cpu
uses: ./.github/workflows/setup_rust_toolchain_for_concrete_cpu
- name: Download cargo cache
uses: Swatinem/rust-cache@v2
- name: Tests
run: |
cd backends/concrete-cpu/implementation
cargo test --no-fail-fast --all-targets