-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
80 lines (72 loc) · 2.73 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
80 lines (72 loc) · 2.73 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
image: "nisectuni/qubip-ossl-rust-runner:latest-nix"
variables:
GIT_SUBMODULE_STRATEGY: recursive
default:
before_script:
- export DEBIAN_FRONTEND=noninteractive
# Spit out relevant info
- rustc --version
- cargo --version
- openssl version -a
stages:
- lint
- test
just-list:
stage: test
script:
- cargo build
- openssl list -verbose -providers -provider $PWD/target/debug/libaurora.so
- openssl list -verbose -all-algorithms -provider $PWD/target/debug/libaurora.so
test-code:
stage: test
script:
- cargo test --no-fail-fast
#- cargo install cargo-tarpaulin
#- cargo tarpaulin --ignore-tests
test-code-pqclean:
stage: test
script:
#- CARGO_INSTALL_ROOT=/ cargo install cargo-nextest --version 0.9.100 --locked
- CARGO_INSTALL_ROOT=/ cargo install jaq
- QUERY='.features.default - ["default_adapters"] + .features.default_adapters - ["mldsa_native_adapter"] + ["pqclean_adapter"] | join(",")'
- TEST_FEATURES="$(jaq -r "$QUERY" Cargo.toml)"
- echo "TEST_FEATURES=\"${TEST_FEATURES}\"" >&2
# We must set TEST_NO_DEFAULT_FEATURES and TEST_FEATURES as inherited
# environment variables when running `cargo test`.
# Without this, the cdylib may be built with a different feature set than
# the one used for the tests themselves.
#
# Integration tests (the ones in `/tests/`) use a custom setup that invokes
# `cargo build` at the beginning of their execution to ensure the aurora
# cdylib is up-to-date.
#
# However, Cargo does not propagate the CLI flags of `cargo test` (such as
# `--no-default-features` and `--features=...`) to subprocesses.
# As a result, when the test binaries run and their `setup()` executes,
# this feature configuration is no longer visible.
# Consequently, the `cargo build` invoked from within the integration tests
# would run with default features enabled unless we explicitly forward the
# desired configuration via environment variables.
#
# These environment variables MUST be kept in sync with the `cargo test`
# CLI arguments.
# Since Cargo does not propagate feature flags to subprocesses, this manual
# forwarding is required to ensure the inner `cargo build` uses the same
# feature configuration.
- TEST_NO_DEFAULT_FEATURES=1 TEST_FEATURES="$TEST_FEATURES" cargo test --no-fail-fast --no-default-features --features="${TEST_FEATURES}"
test-doc:
stage: test
script:
- cargo doc --document-private-items
lint-code:
stage: lint
script:
#- rustup component add rustfmt
- cargo fmt -- --check
#- rustup component add clippy
#- cargo clippy -- -D warnings
# audit-code:
# stage: test
# script:
# - cargo install cargo-audit
# - cargo audit