-
Notifications
You must be signed in to change notification settings - Fork 10
129 lines (104 loc) · 3.12 KB
/
rust-tests.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
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
124
125
126
127
128
129
name: Rust CI
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
push:
branches:
- main
jobs:
check-formatting-linting:
permissions:
contents: read
checks: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt -- --check
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets -p nethsm_pkcs11 -- -D warnings --no-deps
tests:
runs-on: ubuntu-latest
container: debian:12
env:
RUST_BACKTRACE: full
RUST_LOG: trace
services:
nethsm:
image: nitrokey/nethsm:testing
ports:
- 8443:8443
steps:
- uses: actions/checkout@v2
- name: install opensc and dependencies
run: apt-get update && apt-get install -y curl opensc openssl gcc xxd jq gnutls-bin make
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy, llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: install demangler
run: cargo install rustfilt
- name: Build with profiling
run: ./tools/build_profiling.sh
- name: repalce localhost with nethsm
run: sed -i 's/localhost/nethsm/g' ./tools/*.sh ./tools/tests/*.sh ./p11nethsm.conf ./tools/*.conf
- name: setup NetHSM
run: ./tools/ci_setup.sh
- name: cargo test
run: ./tools/test_profiling.sh
- name: Run integration tests
run: ./tools/ci_integration_tests.sh
- name: get coverage
run: ./tools/get_coverage.sh
- name: upload coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
verbose: true
- name: build release
run: cargo build --release
- name: run fork tests
run: cd fork-tests && make
test_network:
runs-on: ubuntu-latest
# container:
# image: ubuntu:24.04
# options: --privileged
env:
RUST_BACKTRACE: full
RUST_LOG: trace
# NETHSM_DOCKER_HOSTNAME: nethsm
# services:
# docker:
# image: docker:dind
# options: --privileged
# ports:
# - 2375:2375
steps:
- uses: actions/checkout@v2
- name: install opensc and dependencies
run: apt-get update && apt-get install -y curl opensc openssl gcc xxd jq gnutls-bin make docker.io
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy, llvm-tools-preview
- name: pull docker image
run: docker pull nitrokey/nethsm:testing
- uses: Swatinem/rust-cache@v2
- name: build release
run: cargo build --release
- name: run network tests
run: cargo t --features pkcs11-full-tests -p nethsm_pkcs11 --test basic