-
-
Notifications
You must be signed in to change notification settings - Fork 23
88 lines (71 loc) · 3.12 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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: ["1.73.0", stable, beta, nightly]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- 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
# OpenSSL AES
- run: cargo test --no-default-features --features openssl
- run: cargo test --no-default-features --features openssl,std
- run: cargo test --no-default-features --features openssl,aes-12bytes-nonce
- run: cargo test --no-default-features --features openssl,std,aes-12bytes-nonce
# Pure Rust AES
- run: cargo test --no-default-features --features pure
- run: cargo test --no-default-features --features pure,std
- run: cargo test --no-default-features --features pure,aes-12bytes-nonce
- run: cargo test --no-default-features --features pure,std,aes-12bytes-nonce
# XChaCha20
- run: cargo test --no-default-features --features xchacha20
- run: cargo test --no-default-features --features xchacha20,std
# 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@v3
with:
files: .lcov.info
- name: Check cargo package
run: cargo publish --dry-run
if: matrix.os != 'windows-latest'