Skip to content

Commit 68e1145

Browse files
authored
Merge pull request #319 from Superhepper/msrv
Adds MSRV ci check
2 parents d0b3fe4 + 8df6328 commit 68e1145

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@ jobs:
2323
- uses: actions/checkout@v2
2424
- name: Check formatting
2525
run: cargo fmt --all -- --check
26-
26+
# Check that it builds with the Minimum Supported Rust Version
27+
msrv:
28+
name: Check minimum supported rust version (MSRV)
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Build the container
33+
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
34+
- name: Run the container
35+
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.53.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
2736
# All in one job as I think it is a big overhead to build and run the Docker
2837
# container?
2938
tests-ubuntu:

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ The `tss-esapi` Rust crate provides an idiomatic interface to the TCG TSS 2.0 En
66

77
At the moment we test (via CI) and support the following Rust compiler versions:
88

9-
* On Ubuntu we test with the latest stable compiler version, as accessible through `rustup`.
9+
* On Ubuntu we test with:
10+
- The latest stable compiler version, as accessible through `rustup`.
11+
- The 1.53 compiler version.
1012
* On Fedora we test with the compiler version included with the Fedora 33 release.
1113

1214
If you need support for other versions of the compiler, get in touch with us to see what we can do!

tss-esapi/tests/all-ubuntu.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
set -euf -o pipefail
1212

13+
#################################################
14+
# Change rust toolchain version
15+
#################################################
16+
if [[ ! -z ${RUST_TOOLCHAIN_VERSION:+x} ]]; then
17+
rustup override set ${RUST_TOOLCHAIN_VERSION}
18+
fi
19+
1320
#################################################
1421
# Generate bindings for non-"standard" versions #
1522
#################################################

tss-esapi/tests/integration_tests/abstraction_tests/transient_key_context_tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,8 @@ fn activate_credential() {
618618
let (material, auth) = ctx.create_key(params, 16).unwrap();
619619
let obj = ObjectWrapper {
620620
material,
621-
auth,
622621
params,
622+
auth,
623623
};
624624
let make_cred_params = ctx.get_make_cred_params(obj.clone(), None).unwrap();
625625

@@ -696,8 +696,8 @@ fn make_cred_params_name() {
696696
let (material, auth) = ctx.create_key(params, 16).unwrap();
697697
let obj = ObjectWrapper {
698698
material,
699-
auth,
700699
params,
700+
auth,
701701
};
702702
let make_cred_params = ctx.get_make_cred_params(obj, None).unwrap();
703703

@@ -729,17 +729,17 @@ fn activate_credential_wrong_key() {
729729
let (material, auth) = ctx.create_key(params, 16).unwrap();
730730
let obj = ObjectWrapper {
731731
material,
732-
auth,
733732
params,
733+
auth,
734734
};
735735
let make_cred_params = ctx.get_make_cred_params(obj, None).unwrap();
736736

737737
// "Wrong" key (which will be used instead of the good key in attestation)
738738
let (material, auth) = ctx.create_key(params, 16).unwrap();
739739
let wrong_obj = ObjectWrapper {
740740
material,
741-
auth,
742741
params,
742+
auth,
743743
};
744744

745745
drop(ctx);
@@ -824,8 +824,8 @@ fn activate_credential_wrong_data() {
824824
let (material, auth) = ctx.create_key(params, 16).unwrap();
825825
let obj = ObjectWrapper {
826826
material,
827-
auth,
828827
params,
828+
auth,
829829
};
830830

831831
// No data (essentially wrong size)

tss-esapi/tests/integration_tests/structures_tests/lists_tests/command_code_list_tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ fn test_conversions() {
4141
});
4242

4343
let tpml_cc: TPML_CC = command_code_list
44-
.clone()
4544
.try_into()
4645
.expect("Failed to convert CommandCodeList into TPML_CC");
4746

0 commit comments

Comments
 (0)