Skip to content

Commit f6addd3

Browse files
authored
Update rustls integ test (#717)
* Update rustls integ test * Only find release commit if needed
1 parent 535123f commit f6addd3

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

.github/workflows/integration.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
fail-fast: false
5151
matrix:
5252
os: [ ubuntu-latest, macos-13, macos-14-xlarge ]
53+
latest: [ 0, 1 ]
5354
steps:
5455
- uses: actions/checkout@v3
5556
with:
@@ -63,7 +64,7 @@ jobs:
6364
- name: Run rustls integration
6465
working-directory: ./aws-lc-rs
6566
run: |
66-
./scripts/run-rustls-integration.sh
67+
./scripts/run-rustls-integration.sh ${{ matrix.latest == 1 && '--latest-release' }}
6768
6869
windows-debug-crt-static-test:
6970
if: github.repository_owner == 'aws'

aws-lc-rs/scripts/run-rustls-integration.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
ROOT="${GITHUB_WORKSPACE:-$(git rev-parse --show-toplevel)}"
66

7+
latest_release=0
8+
for arg in "$@"; do
9+
if [ "$arg" = "--latest-release" ]; then
10+
latest_release=1
11+
fi
12+
done
13+
714
CLEANUP_ON_EXIT=()
815

916
function cleanup() {
@@ -49,9 +56,11 @@ rm -rf "${RUSTLS_WEBPKI_DIR}" # Cleanup before we clone
4956

5057
RUSTLS_DIR="$(mktemp -d)"
5158
CLEANUP_ON_EXIT+=("${RUSTLS_DIR}")
52-
cargo download rustls | tar xvzf - -C "${RUSTLS_DIR}" --strip-components=1
53-
RUSTLS_COMMIT="$(jq -r '.git.sha1' ${RUSTLS_DIR}/.cargo_vcs_info.json)"
54-
rm -rf "${RUSTLS_DIR}" # Cleanup before we clone
59+
if [[ $latest_release == "1" ]]; then
60+
cargo download rustls | tar xvzf - -C "${RUSTLS_DIR}" --strip-components=1
61+
RUSTLS_COMMIT="$(jq -r '.git.sha1' ${RUSTLS_DIR}/.cargo_vcs_info.json)"
62+
rm -rf "${RUSTLS_DIR}" # Cleanup before we clone
63+
fi
5564

5665
git clone https://github.com/rustls/rcgen "${RUSTLS_RCGEN_DIR}"
5766
git clone https://github.com/rustls/webpki.git "${RUSTLS_WEBPKI_DIR}"
@@ -86,12 +95,14 @@ fi
8695
# Trigger Cargo to generate the lock file
8796
cargo update
8897
cargo update "aws-lc-rs@${AWS_LC_RS_VERSION}"
89-
cargo tree -i aws-lc-rs --features aws_lc_rs
90-
cargo test --features aws_lc_rs
98+
cargo tree -i aws-lc-rs --features aws-lc-rs
99+
cargo test --features aws-lc-rs
91100
popd &>/dev/null # "${RUSTLS_WEBPKI_DIR}"
92101

93102
pushd "${RUSTLS_DIR}"
94-
git checkout "${RUSTLS_COMMIT}"
103+
if [[ $latest_release == "1" ]]; then
104+
git checkout "${RUSTLS_COMMIT}"
105+
fi
95106
rm Cargo.lock
96107
# Update the Cargo.toml to use the GitHub repository reference under test.
97108
RUSTLS_RCGEN_STRING="^rcgen = { .* }"
@@ -114,8 +125,8 @@ pushd ./rustls
114125

115126
# Print the dependency tree for debug purposes, if we did everything right there
116127
# should only be one aws-lc-rs version. Otherwise this will fail sine there are multiple versions
117-
cargo tree -i aws-lc-rs --features aws_lc_rs
118-
# Run the rustls tests with the aws_lc_rs feature enabled
119-
cargo test --features aws_lc_rs
128+
cargo tree -i aws-lc-rs --features aws-lc-rs
129+
# Run the rustls tests with the aws-lc-rs feature enabled
130+
cargo test --features aws-lc-rs
120131
popd &>/dev/null # ./rustls
121132
popd &>/dev/null # ${RUSTLS_DIR}

0 commit comments

Comments
 (0)