forked from parallaxsecond/rust-tss-esapi
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (113 loc) · 5.78 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
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
name: Continuous Integration
on: [push, pull_request]
jobs:
# Use the following command to fix words locally:
# codespell --write-changes
check-spelling:
name: Check spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check spelling
uses: codespell-project/actions-codespell@v1
with:
exclude_file: tss-esapi/examples/symmetric_file_encrypt_decrypt_example.txt
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check formatting
run: cargo fmt --all -- --check
# Check that it builds with the Minimum Supported Rust Version
msrv:
name: Check minimum supported rust version (MSRV)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
- name: Run the container
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.74.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
# All in one job as I think it is a big overhead to build and run the Docker
# container?
tests-ubuntu:
name: Ubuntu tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
- name: Run the container
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
- name: Run the cross-compilation script
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/cross-compile.sh
tests-ubuntu-v4-pkg:
name: Ubuntu tests on v4.x.y of tpm2-tss libraries found using pkg-config --target tpm2-tools
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=4.1.3 --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
- name: Run the container
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
test-ubuntu-v4-path:
name: Ubuntu tests on v4.x.y of tpm2-tss libraries found using a path
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=4.0.1 --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tss-install-dir
- name: Run the container
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
tests-fedora:
name: Fedora tests
# We just build a container... GitHub doesn't like Fedora :(
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t fedoracontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-fedora
- name: Run the tests
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env USE_FROZEN_LOCKFILE=1 fedoracontainer dbus-run-session -- /tmp/rust-tss-esapi/tss-esapi/tests/all-fedora.sh
tests-fedora-rawhide:
name: Fedora rawhide tests
# We just build a container... GitHub doesn't like Fedora :(
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t fedoracontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-fedora-rawhide
- name: Run the tests
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --security-opt seccomp=unconfined fedoracontainer dbus-run-session -- /tmp/rust-tss-esapi/tss-esapi/tests/all-fedora.sh
tests-valgrind:
name: Valgrind test run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
- name: Run the tests
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/valgrind.sh
# Check that the documentation builds as well.
docs:
name: Check documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
- name: Check documentation
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi -e RUSTDOCFLAGS="-Dwarnings" ubuntucontainer cargo doc --document-private-items --no-deps
# Check that there are no Clippy lint errors.
clippy:
name: Check Clippy lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tss
- name: Check Clippy lints MSRV
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.74.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh
- name: Check Clippy lints latest
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh