-
Notifications
You must be signed in to change notification settings - Fork 69
123 lines (101 loc) · 4.25 KB
/
Copy pathci.yml
File metadata and controls
123 lines (101 loc) · 4.25 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
on: [push, pull_request, merge_group, repository_dispatch]
name: Continuous integration
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
rust:
- stable
- beta
- nightly
update-liboqs:
- true
- false
env:
# 20 MiB stack
RUST_MIN_STACK: 20971520
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Update liboqs submodule
if: matrix.update-liboqs
run: git submodule update --remote
- name: Set stack size
if: startsWith(matrix.os, 'windows')
run: echo "RUSTFLAGS=-C link-arg=/STACK:20971520" >> $env:GITHUB_ENV
- name: Install LLVM and Clang
if: startsWith(matrix.os, 'windows')
uses: KyleMayes/install-llvm-action@v2.0.7
with:
version: "13.0"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
if: startsWith(matrix.os, 'windows')
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
- name: Install OpenSSL
if: startsWith(matrix.os, 'windows')
run: |
if (-not (Test-Path "C:/Program Files/OpenSSL")) {
if (Get-Command choco -ErrorAction SilentlyContinue) {
choco install openssl -y
} elseif (Get-Command winget -ErrorAction SilentlyContinue) {
winget install --id ShiningLight.OpenSSL --accept-source-agreements --accept-package-agreements
} else {
throw "Neither choco nor winget found to install OpenSSL"
}
}
- name: Set OPENSSL_ROOT_DIR
if: startsWith(matrix.os, 'windows')
run: |
$opensslRoot = "C:/Program Files/OpenSSL"
echo "OPENSSL_ROOT_DIR=$opensslRoot" >> $env:GITHUB_ENV
# Find the actual library directory (Chocolatey puts it in lib/VC/x64/MD or similar)
$libcrypto = Get-ChildItem -Path $opensslRoot -Recurse -Filter "libcrypto.lib" -ErrorAction SilentlyContinue | Select-Object -First 1
if ($libcrypto) {
$libDir = $libcrypto.DirectoryName
echo "OPENSSL_LIB_DIR=$libDir" >> $env:GITHUB_ENV
echo "Found OpenSSL lib at: $libDir"
} else {
echo "Warning: libcrypto.lib not found under $opensslRoot"
}
- name: Set OPENSSL_ROOT_DIR
if: startsWith(matrix.os, 'macos')
run: echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl)" >> $GITHUB_ENV
- name: Install Rust
run: |
rustup set auto-self-update disable
rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt --component clippy
rustup default ${{ matrix.rust }}
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
echo RUST_BACKTRACE=1 >> $GITHUB_ENV
shell: bash
- uses: Swatinem/rust-cache@v2
- name: Cargo build
run: cargo build
- name: Cargo test
run: cargo test
- name: Cargo test --no-default-features
run: cargo test --no-default-features
- name: Cargo test --no-default-features --features serde,kems,sigs,std
run: cargo test --no-default-features --features serde,kems,sigs,std --manifest-path oqs/Cargo.toml
- name: Cargo test --no-default-features --features serde,kems,sigs
run: cargo test --no-default-features --features serde,kems,sigs --manifest-path oqs/Cargo.toml
- name: Cargo test --no-default-features --features non_portable,kems,sigs,std
run: cargo test --no-default-features --features non_portable,kems,sigs,std --manifest-path oqs/Cargo.toml
# skip windows, because the default image doesn't include several of the
# system dependencies (e.g. Perl) required for the openssl-sys/vendored
- name: Cargo test --features vendored_openssl
if: matrix.os != 'windows-latest'
run: cargo test --features vendored_openssl --manifest-path oqs/Cargo.toml
- name: Cargo fmt
run: cargo fmt --all -- --check
- name: Cargo clippy
run: cargo clippy
# vim: set ft=yaml ts=2 sw=2 tw=0 et :