Files
concrete/.github/workflows/concrete_cpu_test.yml

127 lines
2.6 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: stable
- name: Download cargo cache
uses: Swatinem/rust-cache@v2
- name: Formatting
run: |
cd backends/concrete-cpu
cargo fmt --check
- name: Remove header to force regeneration
run: |
cd backends/concrete-cpu
rm include/concrete-cpu.h
- name: Build
run: |
cd backends/concrete-cpu
cargo build --all-targets
- name: Check regenerated header is unchanged
run: |
cd backends/concrete-cpu
git diff --exit-code
- name: Lint
run: |
cd backends/concrete-cpu
cargo clippy --all-targets
- name: Tests
run: |
cd backends/concrete-cpu
cargo test --no-fail-fast --all-targets
- name: Zig install
run: |
sudo snap install zig --classic --beta
- name: Zig test
run: |
cd backends/concrete-cpu/test
make test
tests-mac_x86:
runs-on: macos-11
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- name: Rust install
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Download cargo cache
uses: Swatinem/rust-cache@v2
- name: Tests
run: |
cd backends/concrete-cpu
cargo test --no-fail-fast --all-targets
- name: Zig install
run: |
brew install zig
- name: Zig test
run: |
cd backends/concrete-cpu/test
make test
tests-mac-m1:
runs-on: m1mac
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- name: Rust install
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Download cargo cache
uses: Swatinem/rust-cache@v2
- name: Tests
run: |
cd backends/concrete-cpu
cargo test --no-fail-fast --all-targets
- name: Zig install
run: |
brew install zig
- name: Zig test
run: |
cd backends/concrete-cpu/test
make test