Skip to content

Commit b75d2ad

Browse files
authored
Merge pull request #477 from Superhepper/win-build
Adds support for non pkg-config tpm2-tss installs.
2 parents fde17bb + 7ab6abf commit b75d2ad

File tree

5 files changed

+530
-104
lines changed

5 files changed

+530
-104
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v2
2929
- name: Build the container
30-
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
30+
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
3131
- name: Run the container
3232
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/all-ubuntu.sh
3333
# All in one job as I think it is a big overhead to build and run the Docker
@@ -38,19 +38,29 @@ jobs:
3838
steps:
3939
- uses: actions/checkout@v2
4040
- name: Build the container
41-
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
41+
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
4242
- name: Run the container
4343
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
4444
- name: Run the cross-compilation script
4545
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
4646

47-
tests-ubuntu-v4:
48-
name: Ubuntu tests on v4.x.y of tpm2-tss
47+
tests-ubuntu-v4-pkg:
48+
name: Ubuntu tests on v4.x.y of tpm2-tss libraries found using pkg-config --target tpm2-tools
4949
runs-on: ubuntu-latest
5050
steps:
5151
- uses: actions/checkout@v2
5252
- name: Build the container
53-
run: docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=4.0.1 --file tss-esapi/tests/Dockerfile-ubuntu
53+
run: docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=4.0.1 --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
54+
- name: Run the container
55+
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
56+
57+
test-ubuntu-v4-path:
58+
name: Ubuntu tests on v4.x.y of tpm2-tss libraries found using a path
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v2
62+
- name: Build the container
63+
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
5464
- name: Run the container
5565
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
5666

@@ -82,7 +92,7 @@ jobs:
8292
steps:
8393
- uses: actions/checkout@v2
8494
- name: Build the container
85-
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
95+
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
8696
- name: Run the tests
8797
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
8898

@@ -93,7 +103,7 @@ jobs:
93103
steps:
94104
- uses: actions/checkout@v2
95105
- name: Build the container
96-
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
106+
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
97107
- name: Check documentation
98108
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
99109

tss-esapi-sys/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ rust-version = "1.66.0"
1717
bindgen = { version = "0.66.1", optional = true }
1818
pkg-config = "0.3.18"
1919
target-lexicon = "0.12.0"
20+
cfg-if = "1.0.0"
21+
semver = "1.0.7"
2022

2123
[features]
2224
generate-bindings = ["bindgen"]

0 commit comments

Comments
 (0)