Update actions/checkout action to v6 (#34) #178
This file contains hidden or 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: Lint and Test | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Default features (long, offline, batch, serde, json, build-binary) | |
| - features: "" | |
| name: "default" | |
| # Special behavior-changing features | |
| - features: "elgamal3" | |
| name: "default+elgamal3" | |
| - features: "legacy" | |
| name: "default+legacy" | |
| # Python bindings | |
| - features: "python" | |
| name: "default+python" | |
| - features: "python,elgamal3" | |
| name: "default+python+elgamal3" | |
| # WASM bindings | |
| - features: "wasm" | |
| name: "default+wasm" | |
| - features: "wasm,elgamal3" | |
| name: "default+wasm+elgamal3" | |
| name: cargo clippy (${{ matrix.name }}) | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo clippy --all-targets --features "${{ matrix.features }}" -- -D warnings | |
| fmt: | |
| runs-on: ubuntu-latest | |
| name: cargo fmt | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - run: cargo fmt -- --check | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Default features | |
| - features: "" | |
| name: "default" | |
| # Special behavior-changing features | |
| - features: "elgamal3" | |
| name: "default+elgamal3" | |
| - features: "legacy" | |
| name: "default+legacy" | |
| # Python bindings | |
| - features: "python" | |
| name: "default+python" | |
| - features: "python,elgamal3" | |
| name: "default+python+elgamal3" | |
| # WASM bindings | |
| - features: "wasm" | |
| name: "default+wasm" | |
| - features: "wasm,elgamal3" | |
| name: "default+wasm+elgamal3" | |
| name: cargo test (${{ matrix.name }}) | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo test --features "${{ matrix.features }}" | |
| - run: cargo doc --no-deps --features "${{ matrix.features }}" | |
| test-python: | |
| runs-on: ubuntu-latest | |
| name: test python bindings | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Create virtual environment | |
| run: python -m venv .venv | |
| - name: Install dependencies and build Python extension | |
| run: | | |
| source .venv/bin/activate | |
| pip install maturin pytest | |
| maturin develop --features python | |
| - name: Run Python tests | |
| run: | | |
| source .venv/bin/activate | |
| python -m unittest discover tests/python/ -v | |
| test-wasm: | |
| runs-on: ubuntu-latest | |
| name: test wasm bindings | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| - run: cargo install wasm-pack | |
| - run: npm install | |
| - name: Build and test WASM package | |
| run: npm test |