Skip to content

Revamp elliptic tests (#125) #192

Revamp elliptic tests (#125)

Revamp elliptic tests (#125) #192

Workflow file for this run

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
# Pure Rust AES and XChaCha20 on WASM target
- run: cargo install wasm-bindgen-cli || true
- run: cargo test --no-default-features --features pure --target=wasm32-unknown-unknown
- run: cargo test --no-default-features --features pure,std --target=wasm32-unknown-unknown
- run: cargo test --no-default-features --features xchacha20 --target=wasm32-unknown-unknown
- run: cargo test --no-default-features --features xchacha20,std --target=wasm32-unknown-unknown
# 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
- run: cargo generate-lockfile
- uses: Swatinem/rust-cache@v2
- run: cargo build