diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000000000000000000000000000000000000..0015055659c2c3f53b6ebcb64f7af80a0223a875 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,3 @@ +[build] +# Share one `target` directory at the project root for all Cargo projects and workspaces in smithy-rs +target-dir = "target" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b6a45ad555553852ee437dd6e15212e055a46b93..06116c9323355a6014f343846e99b60c4286f0ef 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,6 +31,7 @@ jobs: ${{ runner.os }}-gradle- - name: ktlint run: ./gradlew ktlint + unit-tests: name: Codegen unit tests runs-on: ubuntu-latest @@ -64,6 +65,7 @@ jobs: run: ./gradlew :codegen:test - name: aws tests run: ./gradlew :aws:sdk-codegen:test + integration-tests: name: Codegen integration tests runs-on: ubuntu-latest @@ -106,6 +108,7 @@ jobs: path: | codegen-test/build/smithyprojections/codegen-test/*/rust-codegen/ codegen-test/build/smithyprojections/codegen-test/Cargo.toml + runtime-tests: name: Rust runtime tests strategy: @@ -128,7 +131,7 @@ jobs: components: ${{ env.rust_toolchain_components }} default: true - name: Format Check - run: rustfmt --check --edition 2018 $(find -name '*.rs' -print) + run: rustfmt --check --edition 2018 $(find -name '*.rs' -print | grep -v /target/) # windows doesn't support using --check like this if: ${{ matrix.os == 'ubuntu-latest' }} - name: clippy check @@ -146,7 +149,7 @@ jobs: RUSTDOCFLAGS: -D warnings generate-sdk: - name: Generate an AWS SDK + name: AWS Rust SDK Tier 1 - Generate runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -170,8 +173,6 @@ jobs: java-version: ${{ env.java_version }} - name: Generate the SDK run: ./gradlew :aws:sdk:assemble - - name: Generate the SDK...again? - run: ./gradlew :aws:sdk:assemble - name: Generate a list of services with tests run: python aws/sdk/test-services.py > aws/sdk/build/aws-sdk/services-with-tests - name: Generate a name for the SDK @@ -186,7 +187,7 @@ jobs: path: sdk.tar check-sdk: - name: cargo check AWS SDK + name: AWS Rust SDK Tier 1 - cargo check needs: generate-sdk runs-on: ubuntu-latest steps: @@ -219,10 +220,11 @@ jobs: run: cargo check --lib --tests --benches working-directory: aws-sdk env: + RUSTC_FORCE_INCREMENTAL: 1 RUSTFLAGS: -D warnings - CARGO_TARGET_DIR: ../target + test-sdk: - name: cargo test AWS SDK + name: AWS Rust SDK Tier 1 - cargo test needs: generate-sdk runs-on: ubuntu-latest steps: @@ -252,14 +254,14 @@ jobs: ${{ runner.os }}-${{ env.rust_version }}-${{ github.job }}- ${{ runner.os }}-${{ env.rust_version }}- - name: Cargo Test - run: cargo test $(cat services-with-tests) + run: cargo test $(cat service-with-tests) working-directory: aws-sdk env: RUSTC_FORCE_INCREMENTAL: 1 RUSTFLAGS: -D warnings - CARGO_TARGET_DIR: ../target + docs-sdk: - name: cargo docs AWS SDK + name: AWS Rust SDK Tier 1 - cargo docs needs: generate-sdk runs-on: ubuntu-latest steps: @@ -290,8 +292,9 @@ jobs: working-directory: aws-sdk env: RUSTDOCFLAGS: -D warnings + clippy-sdk: - name: cargo clippy AWS SDK + name: AWS Rust SDK Tier 1 - cargo clippy needs: generate-sdk runs-on: ubuntu-latest steps: @@ -321,8 +324,45 @@ jobs: run: cargo clippy -- -D warnings working-directory: aws-sdk + standalone-integration-tests-check: + name: AWS Rust SDK Standalone Integration Tests - cargo check + needs: generate-sdk + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + name: Gradle Cache + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.rust_version }} + components: ${{ env.rust_toolchain_components }} + default: true + - name: Generate a name for the SDK + id: gen-name + run: echo "name=${GITHUB_REF##*/}" >> $GITHUB_ENV + - uses: actions/download-artifact@v2 + name: Download SDK Artifact + with: + name: aws-sdk-${{ env.name }}-tier1-${{ github.sha }} + path: artifact + - name: untar + run: mkdir -p aws/sdk/build/aws-sdk && cd aws/sdk/build/aws-sdk && tar -xvf ../../../../artifact/sdk.tar + - name: Check integration tests + run: cargo check + working-directory: aws/sdk/integration-tests + env: + RUSTC_FORCE_INCREMENTAL: 1 + RUSTFLAGS: -D warnings + all-services-check: - name: cargo check all services + name: AWS Rust SDK Tier 2 - Generate and cargo check runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -344,7 +384,7 @@ jobs: uses: actions/setup-java@v1 with: java-version: ${{ env.java_version }} - - name: generate a check all services + - name: Generate and check all services run: ./gradlew -Paws.fullsdk=true :aws:sdk:cargoCheck - name: Generate a name for the SDK id: gen-name diff --git a/aws/sdk/integration-tests/Cargo.toml b/aws/sdk/integration-tests/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..bcfccd7808b5bce1183b177e31f704e5a5e22ae2 --- /dev/null +++ b/aws/sdk/integration-tests/Cargo.toml @@ -0,0 +1,10 @@ +# Note: this workspace exists solely for the convenience of running tests. These packages will all eventually +# end up in the final SDK workspace. +[workspace] +members = [ + "dynamodb", + "iam", + "kms", + "qldbsession", + "s3", +]