Unverified Commit 58d40b76 authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

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._
parent 498dc5fe
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -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
+7 −6
Original line number Diff line number Diff line
@@ -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
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 "aws-sdk-rust/sdk/${sdk}" &>/dev/null
    pushd "$sdk" &>/dev/null
    cargo test --all-features
    popd &>/dev/null
  fi
done