range check #476
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
compatibility_check: | |
name: Check with compatibility requirement | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable 6 months ago | |
components: rustfmt, clippy | |
# - uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt --all --check | |
- run: cargo check --workspace --all-targets --no-default-features --features="count_ntt" | |
- run: cargo check --workspace --all-targets --no-default-features --features="concrete-ntt" | |
- run: cargo clippy --no-deps --all-targets --no-default-features --features="count_ntt" -- -D warnings | |
- run: cargo clippy --no-deps --all-targets --no-default-features --features="concrete-ntt" -- -D warnings | |
# check: | |
# name: Basic check | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: dtolnay/rust-toolchain@stable | |
# with: | |
# components: rustfmt, clippy | |
# # - uses: Swatinem/rust-cache@v2 | |
# - run: cargo fmt --all --check | |
# - run: cargo check --workspace --all-targets --no-default-features --features="count_ntt" | |
# - run: cargo clippy --no-deps --all-targets --no-default-features --features="count_ntt" -- -D warnings | |
doc: | |
name: Document | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
# - uses: Swatinem/rust-cache@v2 | |
- run: cargo test --workspace --doc --features="count_ntt concrete-ntt" | |
- run: cargo doc --no-deps --workspace --lib --document-private-items --no-default-features --features="count_ntt concrete-ntt" | |
test: | |
strategy: | |
matrix: | |
# os: [ubuntu-latest, windows-latest, macos-latest] | |
os: [ubuntu-latest] | |
name: Test | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable 6 months ago | |
# - uses: Swatinem/rust-cache@v2 | |
- run: cargo test --workspace --lib --bins --tests --examples --no-default-features --features="count_ntt" | |
- run: cargo test --workspace --lib --bins --tests --examples --no-default-features --features="concrete-ntt" | |
build: | |
strategy: | |
matrix: | |
platform: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
command: build | |
# - os: windows-latest | |
# target: x86_64-pc-windows-msvc | |
# command: build | |
# - os: macos-latest | |
# target: x86_64-apple-darwin | |
# command: build | |
# - os: ubuntu-latest | |
# target: aarch64-unknown-linux-gnu | |
# command: build | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
command: build | |
name: Build | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build binary | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
command: ${{ matrix.platform.command }} | |
target: ${{ matrix.platform.target }} | |
# args: "--locked --release" | |
# strip: true | |
- uses: Swatinem/rust-cache@v2 |