Skip to content

Commit cedb8c6

Browse files
authored
Merge pull request #275 from ionut-arm/ver-testing
Add version testing to CI
2 parents a5a5ad1 + 6501210 commit cedb8c6

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ jobs:
2323
- name: Run the container
2424
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
2525

26+
tests-ubuntu-v3:
27+
name: Ubuntu tests on v3.x.y of tpm2-tss
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Build the container
32+
run: docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=3.0.4 --file tss-esapi/tests/Dockerfile-ubuntu
33+
- name: Run the container
34+
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
35+
2636
tests-fedora:
2737
name: Fedora tests
2838
# We just build a container... GitHub doesn't like Fedora :(

tss-esapi/tests/Dockerfile-ubuntu

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
FROM ghcr.io/tpm2-software/ubuntu-18.04:latest
22

3+
ARG TPM2_TSS_VERSION=2.3.3
4+
ENV TPM2_TSS_VERSION=$TPM2_TSS_VERSION
35
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
46

5-
# Download and install TSS 2.0
6-
RUN git clone https://github.com/tpm2-software/tpm2-tss.git --branch 2.3.3
7+
# Download and install the TSS library
8+
RUN git clone https://github.com/tpm2-software/tpm2-tss.git --branch $TPM2_TSS_VERSION
79
RUN cd tpm2-tss \
810
&& ./bootstrap \
911
&& ./configure \

tss-esapi/tests/all-ubuntu.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010

1111
set -euf -o pipefail
1212

13+
#################################################
14+
# Generate bindings for non-"standard" versions #
15+
#################################################
16+
if [[ "$TPM2_TSS_VERSION" != "2.3.3" ]]; then
17+
FEATURES="--features=generate-bindings"
18+
else
19+
FEATURES=""
20+
fi
21+
1322
#################################
1423
# Run the TPM simulation server #
1524
#################################
@@ -25,9 +34,9 @@ cargo clippy --all-targets --all-features -- -D clippy::all -D clippy::cargo
2534
###################
2635
# Build the crate #
2736
###################
28-
RUST_BACKTRACE=1 cargo build
37+
RUST_BACKTRACE=1 cargo build $FEATURES
2938

3039
#################
3140
# Run the tests #
3241
#################
33-
TEST_TCTI=mssim: RUST_BACKTRACE=1 RUST_LOG=info cargo test -- --test-threads=1 --nocapture
42+
TEST_TCTI=mssim: RUST_BACKTRACE=1 RUST_LOG=info cargo test $FEATURES -- --test-threads=1 --nocapture

0 commit comments

Comments
 (0)