File tree Expand file tree Collapse file tree 7 files changed +58
-22
lines changed Expand file tree Collapse file tree 7 files changed +58
-22
lines changed Original file line number Diff line number Diff line change 6363 - name : Build the container
6464 run : docker build -t fedoracontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-fedora
6565 - name : Run the tests
66- run : docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi fedoracontainer dbus-run-session -- /tmp/rust-tss-esapi/tss-esapi/tests/all-fedora.sh
66+ 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
6767
6868 tests-fedora-rawhide :
6969 name : Fedora rawhide tests
9696 run : docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
9797 - name : Check documentation
9898 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
99+
100+ # Check that there are no Clippy lint errors.
101+ clippy :
102+ name : Check Clippy lints
103+ runs-on : ubuntu-latest
104+ steps :
105+ - uses : actions/checkout@v2
106+ - name : Build the container
107+ run : docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tss
108+ - name : Check Clippy lints MSRV
109+ run : docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.66.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh
110+ - name : Check Clippy lints latest
111+ 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
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ At the moment we test (via CI) and support the following Rust compiler versions:
1010* On Ubuntu we test with:
1111 - The latest stable compiler version, as accessible through ` rustup ` .
1212 - The 1.66 compiler version.
13- * On Fedora we test with the compiler version included with the Fedora 35 release.
13+ * On Fedora we test with the compiler version included with the Fedora 36 release.
14+ * On Fedora rawhide we test with the compiler version included.
1415
1516If you need support for other versions of the compiler, get in touch with us to see what we can do!
1617
Original file line number Diff line number Diff line change 1- FROM fedora:35
1+ FROM fedora:36
22
33RUN dnf install -y \
44 tpm2-tss-devel tpm2-abrmd tpm2-tools \
Original file line number Diff line number Diff line change 1- FROM ghcr.io/tpm2-software/ubuntu-18.04:latest
1+ FROM ghcr.io/tpm2-software/ubuntu-18.04:latest AS base
22
3+ FROM base AS rust-toolchain
4+ # Install Rust toolchain
5+ RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
6+ ENV PATH="/root/.cargo/bin:${PATH}"
7+
8+ FROM rust-toolchain AS tpm2-tss
9+ # Download and install the TSS library
310ARG TPM2_TSS_VERSION=2.4.6
411ENV TPM2_TSS_VERSION=$TPM2_TSS_VERSION
512ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
6-
7- # Download and install the TSS library
813RUN git clone https://github.com/tpm2-software/tpm2-tss.git --branch $TPM2_TSS_VERSION
914RUN cd tpm2-tss \
1015 && ./bootstrap \
@@ -13,13 +18,10 @@ RUN cd tpm2-tss \
1318 && make install \
1419 && ldconfig
1520
21+ FROM tpm2-tss AS tpm2-tools
1622# Download and install TPM2 tools
1723RUN git clone https://github.com/tpm2-software/tpm2-tools.git --branch 4.1
1824RUN cd tpm2-tools \
1925 && ./bootstrap \
2026 && ./configure --enable-unit \
2127 && make install
22-
23- # Install Rust toolchain
24- RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
25- ENV PATH="/root/.cargo/bin:${PATH}"
Original file line number Diff line number Diff line change 33# Copyright 2019 Contributors to the Parsec project.
44# SPDX-License-Identifier: Apache-2.0
55
6- # This script executes static checks and tests for the tss-esapi crate.
6+ # This script executes tests for the tss-esapi crate.
77# It can be run inside the container which Dockerfile is in the same folder.
88#
99# Usage: ./tests/all.sh
1010
1111set -euf -o pipefail
1212
13+ if [[ ! -z ${USE_FROZEN_LOCKFILE: +x} ]]; then
14+ # Some versions of Fedora that are used during testing are old
15+ # so in order to prevent any drift from the versions available
16+ # in the old versions the frozen Cargo lock is used.
17+ cp tests/Cargo.lock.frozen ../Cargo.lock
18+ fi
19+
1320# ###########################
1421# Run the TPM SWTPM server #
1522# ###########################
@@ -33,11 +40,6 @@ tpm2-abrmd \
3340 --session \
3441 --flush-all &
3542
36- # #################
37- # Execute clippy #
38- # #################
39- cargo clippy --all-targets --all-features -- -D clippy::all -D clippy::cargo
40-
4143# ##################
4244# Build the crate #
4345# ##################
Original file line number Diff line number Diff line change 33# Copyright 2019 Contributors to the Parsec project.
44# SPDX-License-Identifier: Apache-2.0
55
6- # This script executes static checks and tests for the tss-esapi crate.
6+ # This script executes tests for the tss-esapi crate.
77# It can be run inside the container which Dockerfile is in the same folder.
88#
99# Usage: ./tests/all.sh
@@ -36,11 +36,6 @@ tpm_server &
3636sleep 5
3737tpm2_startup -c -T mssim
3838
39- # #################
40- # Execute clippy #
41- # #################
42- cargo clippy --all-targets --all-features -- -D clippy::all -D clippy::cargo
43-
4439# ##################
4540# Build the crate #
4641# ##################
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Copyright 2023 Contributors to the Parsec project.
4+ # SPDX-License-Identifier: Apache-2.0
5+
6+ # This script executes static checks for the tss-esapi crate.
7+
8+ set -euf -o pipefail
9+
10+ # ################################################
11+ # Change rust toolchain version
12+ # ################################################
13+ if [[ ! -z ${RUST_TOOLCHAIN_VERSION: +x} ]]; then
14+ rustup override set ${RUST_TOOLCHAIN_VERSION}
15+ # Use the frozen Cargo lock to prevent any drift from MSRV being upgraded
16+ # underneath our feet.
17+ cp tests/Cargo.lock.frozen ../Cargo.lock
18+ fi
19+
20+ # #################
21+ # Execute clippy #
22+ # #################
23+ cargo clippy --all-targets --all-features -- -D clippy::all -D clippy::cargo
You can’t perform that action at this time.
0 commit comments