More secp256k1 tests (#128) #201
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: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
toolchain: [stable, beta, nightly] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
target: wasm32-unknown-unknown | |
components: rustfmt, clippy, llvm-tools-preview | |
- uses: taiki-e/install-action@cargo-llvm-cov | |
- run: cargo generate-lockfile | |
- uses: Swatinem/rust-cache@v2 | |
# install openssl on Windows | |
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append | |
if: matrix.os == 'windows-latest' | |
- run: New-Item -ItemType "directory" -Path "C:\vcpkg\downloads" -Force | |
if: matrix.os == 'windows-latest' | |
- run: Invoke-WebRequest -URI "$env:BASE_URL/$env:FILE_NAME" -OutFile "C:\vcpkg\downloads\$env:FILE_NAME" | |
env: | |
BASE_URL: https://github.com/microsoft/vcpkg/files/12073957 | |
FILE_NAME: nasm-2.16.01-win64.zip | |
if: matrix.os == 'windows-latest' | |
- run: vcpkg install openssl:x64-windows-static-md | |
if: matrix.os == 'windows-latest' | |
- name: Check and run lint | |
run: cargo check && cargo fmt && cargo clippy | |
- name: Check doc | |
run: cargo doc --no-deps | |
- run: sh ./scripts/test.sh | |
env: | |
CURVE: secp256k1 | |
- run: sh ./scripts/test.sh | |
env: | |
CURVE: x25519 | |
- run: cargo install wasm-bindgen-cli || true | |
- run: sh ./scripts/test-wasm.sh | |
env: | |
CURVE: secp256k1 | |
- run: sh ./scripts/test-wasm.sh | |
env: | |
CURVE: x25519 | |
# Coverage | |
- run: cargo llvm-cov --no-default-features --features pure --lcov --output-path .lcov.info | |
- uses: codecov/codecov-action@v5 | |
if: matrix.os == 'ubuntu-latest' && matrix.toolchain == 'stable' | |
with: | |
files: .lcov.info | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Check cargo package | |
run: cargo publish --dry-run | |
if: matrix.os != 'windows-latest' | |
check-msrv: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: 1.73.0 # msrv | |
- run: cargo generate-lockfile | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo build |