From b7cf08ea505b029b4c0cbc65cd899dcfcc366204 Mon Sep 17 00:00:00 2001 From: Armando Faz Date: Fri, 17 Apr 2026 21:28:24 -0700 Subject: [PATCH] Add CI workflow. --- .cargo/config.toml | 2 + .github/workflows/ci.yml | 86 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 .cargo/config.toml create mode 100644 .github/workflows/ci.yml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..efffee6 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.wasm32-wasip1] +runner = "wasmtime run --dir ." diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..30e96d8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,86 @@ +--- +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + RUST_BACKTRACE: 1 + ALL_FEATURES: suite_p256,suite_ristretto255 + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install Rust (MSRV) + uses: dtolnay/rust-toolchain@1.88 + + - name: Check + run: cargo check --features ${{ env.ALL_FEATURES }} + + - name: Build + run: cargo build --features ${{ env.ALL_FEATURES }} + + - name: Test + run: cargo test --features ${{ env.ALL_FEATURES }} + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install Rust (stable) + uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + + - name: fmt + run: cargo fmt --check + + - name: clippy + run: | + cargo clippy \ + --features ${{ env.ALL_FEATURES }} --all-targets -- -D warnings + + docs: + name: Docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install Rust (stable + nightly for docsrs) + uses: dtolnay/rust-toolchain@nightly + + - name: Build docs (docsrs simulation) + env: + RUSTDOCFLAGS: "--cfg docsrs -D warnings" + run: cargo doc --features ${{ env.ALL_FEATURES }} --no-deps + + wasm: + name: WASM compilation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install Rust (stable + wasm) + uses: dtolnay/rust-toolchain@1.88 + with: + toolchain: stable + target: wasm32-wasip1 + + - name: Install wasmtime + uses: mwilliamson/setup-wasmtime-action@v2 + with: + wasmtime-version: "42.0.2" + + - name: Run tests in WASM + run: | + cargo test \ + --target wasm32-wasip1 --features ${{ env.ALL_FEATURES }}