From 58d40b7686ddf513f1097a6962004ee3bc602c43 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 28 Mar 2024 17:11:15 -0400 Subject: [PATCH] Update CI to check for semver hazards on pull requests (#3535) ## Motivation and Context We've hit issues several times where semver hazards were not discovered until release. Now that we've removed version arguments, we can now run this test on PRs. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ tools/ci-scripts/check-semver-hazards | 13 +++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f31c7696..73a6a5821 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,6 +127,26 @@ jobs: with: action: ${{ matrix.test.action }} + # Separate from the main checks above because it uses aws-sdk-rust from GitHub + check-semver-hazards: + name: Check for semver hazards + runs-on: smithy_ubuntu-latest_8-core + steps: + - uses: actions/checkout@v4 + with: + path: smithy-rs + ref: ${{ inputs.git_ref }} + fetch-depth: 0 + - uses: actions/checkout@v4 + with: + repository: awslabs/aws-sdk-rust + path: aws-sdk-rust + fetch-depth: 0 + - name: Run check-semver-hazards + uses: ./smithy-rs/.github/actions/docker-build + with: + action: check-semver-hazards + # Test all the things that require generated code. Note: the Rust runtimes require codegen # to be checked since `aws-config` depends on the generated STS client. test-sdk: @@ -318,6 +338,7 @@ jobs: needs: - generate - test-codegen + - check-semver-hazards - test-sdk - test-rust-windows - test-exotic-platform-support diff --git a/tools/ci-scripts/check-semver-hazards b/tools/ci-scripts/check-semver-hazards index 563c61774..88765f398 100755 --- a/tools/ci-scripts/check-semver-hazards +++ b/tools/ci-scripts/check-semver-hazards @@ -24,11 +24,12 @@ runtime-versioner patch-runtime \ --sdk-path "$(pwd)/aws-sdk-rust" \ --smithy-rs-path "$(pwd)/smithy-rs" -# Testing just a small subset of the full SDK to check for semver hazards echo -e "${C_YELLOW}# Testing SDK...${C_RESET}" -for sdk in dynamodb s3 aws-config; do - echo -e "${C_YELLOW}# Testing ${sdk}...${C_RESET}" - pushd "aws-sdk-rust/sdk/${sdk}" &>/dev/null - cargo test --all-features - popd &>/dev/null +for sdk in aws-sdk-rust/sdk/*; do + if ls "$sdk/tests" | grep -v '^endpoint_tests\.rs$'; then + echo -e "${C_YELLOW}# Testing ${sdk}...${C_RESET}" + pushd "$sdk" &>/dev/null + cargo test --all-features + popd &>/dev/null + fi done -- GitLab