Skip to content

Commit

Permalink
ml-kem: add initial CI configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Mar 1, 2024
1 parent ea44681 commit 8da85c3
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 3 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ml-kem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: ml-kem

on:
pull_request:
paths:
- ".github/workflows/ml-kem.yml"
- "ml-kem/**"
- "Cargo.*"
push:
branches: master

defaults:
run:
working-directory: ml-kem

env:
RUSTFLAGS: "-Dwarnings"
CARGO_INCREMENTAL: 0

jobs:
set-msrv:
uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master
with:
msrv: 1.74.0

no_std:
needs: set-msrv
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- ${{needs.set-msrv.outputs.msrv}}
- stable
target:
- thumbv7em-none-eabi
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- run: cargo build --no-default-features --target ${{ matrix.target }}

minimal-versions:
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
with:
working-directory: ${{ github.workflow }}

test:
needs: set-msrv
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- ${{needs.set-msrv.outputs.msrv}}
- stable
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- run: cargo test --no-default-features
- run: cargo test
- run: cargo test --all-features

miri:
runs-on: ubuntu-latest
env:
MIRIFLAGS: "-Zmiri-symbolic-alignment-check -Zmiri-strict-provenance"
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- s390x-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Install Miri
run: |
rustup component add miri
cargo miri setup
- name: Test with Miri
run: |
cargo miri test --target ${{ matrix.target }} --no-default-features
cargo miri test --target ${{ matrix.target }}
cargo miri test --target ${{ matrix.target }} --all-features
44 changes: 44 additions & 0 deletions .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Workspace

on:
pull_request:
paths-ignore:
- README.md
push:
branches:
- master
paths-ignore:
- README.md

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"
RUSTDOCFLAGS: "-Dwarnings"

jobs:
clippy:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: clippy
- run: cargo clippy --all-features --all-targets -- -D warnings
- run: cargo clippy --no-default-features --all-targets -- -D warnings

doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo doc --workspace --all-features --document-private-items

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all -- --check
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ resolver = "2"
members = [
"ml-kem",
]

[profile.bench]
debug = true
4 changes: 1 addition & 3 deletions ml-kem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "ml-kem"
version = "0.1.0"
edition = "2021"
rust-version = "1.74"

[features]
default = []
Expand All @@ -20,9 +21,6 @@ hex = "0.4.3"
hex-literal = "0.4.1"
rand = "0.8.5"

[profile.bench]
debug = true

[[bench]]
name = "mlkem"
harness = false

0 comments on commit 8da85c3

Please sign in to comment.