Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 17 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
name: Rust CI
name: C CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -21,25 +18,17 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential cmake libssl-dev

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Check code format
run: cargo fmt -- --check

- name: Clippy
run: cargo clippy -- -D warnings
- name: Configure
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON

- name: Build
run: cargo build --verbose
run: cmake --build build --verbose

- name: Run tests
run: cargo test --verbose
run: cd build && ctest -V

build-matrix:
name: Build on ${{ matrix.os }}
Expand All @@ -48,7 +37,6 @@ jobs:
matrix:
os: [ubuntu-latest]
# os: [ubuntu-latest, macos-latest]
rust: [stable]
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand All @@ -64,45 +52,14 @@ jobs:
run: |
brew install cmake

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
components: clippy, rustfmt

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Check code format
run: cargo fmt -- --check

- name: Clippy
run: cargo clippy -- -D warnings
- name: Configure
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON

- name: Build
run: cargo build --verbose
run: cmake --build build --verbose

- name: Run tests
run: cargo test --verbose

# benchmark:
# name: Benchmark
# runs-on: ubuntu-latest
# needs: test
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# steps:
# - uses: actions/checkout@v3

# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y build-essential cmake libssl-dev

# - name: Install Rust
# uses: dtolnay/rust-toolchain@stable

# - name: Cache dependencies
# uses: Swatinem/rust-cache@v2

# - name: Run benchmarks
# run: cargo bench
run: cd build && ctest -V
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
build/
dist/
*.o
benchmark_results.txt
__pycache__
python/build/
*.egg-info/
node_modules/
**.gcno
**.lcov
**/target/
tags
TAGS
rust-toolchain.toml
Cargo.lock
5 changes: 1 addition & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"rust-analyzer.cargo.features": ["ide"],
"editor.formatOnSave": true,
"rust-analyzer.check.command": "clippy",
"rust-analyzer.check.extraArgs": ["--all-targets"]
"editor.formatOnSave": true
}
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ include_directories(

# Custom randombytes implementation
set(CUSTOM_RANDOMBYTES
dilithium/ref/randombytes_custom.c
sphincsplus/ref/randombytes_custom.c
src/randombytes_custom.c
)

# ML-DSA-44 (Dilithium) source files
Expand Down
Loading