diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35febf0ae4..8568cf8271 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,22 +9,39 @@ env: CARGO_INCREMENTAL: 0 jobs: + msrv: + name: Get minimum supported rust version + runs-on: ubuntu-20.04 + outputs: + msrv: ${{ steps.get_msrv.outputs.msrv }} + steps: + - uses: actions/checkout@v3 + - id: get_msrv + run: | + MSRV=$(cargo metadata --format-version=1 --no-deps | jq '.packages[] | select(.name == "azure_core").rust_version' -r) + echo setting msrv to ${MSRV} + echo msrv=${MSRV} >> "$GITHUB_OUTPUT" + code-style: name: Code Style runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 - - run: eng/scripts/code_style.sh + # for code style, we only care about `stable` + - run: eng/scripts/code_style.sh stable test-sdk: name: SDK Tests runs-on: ubuntu-20.04 + needs: + - msrv strategy: matrix: build: - stable - nightly + - ${{ needs.msrv.outputs.msrv }} steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -33,12 +50,20 @@ jobs: test-services: name: Services Tests runs-on: ubuntu-20.04 + needs: + - msrv + strategy: + matrix: + build: + - stable + - nightly + - ${{ needs.msrv.outputs.msrv }} steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 with: workspaces: services - - run: eng/scripts/services_tests.sh + - run: eng/scripts/services_tests.sh ${{ matrix.build }} - name: display free disk space run: df -h / if: ${{ always() }} @@ -46,17 +71,18 @@ jobs: test-integration: name: Integration Tests runs-on: ubuntu-20.04 + needs: + - msrv + strategy: + matrix: + build: + - stable + - nightly + - ${{ needs.msrv.outputs.msrv }} steps: - uses: actions/checkout@v3 - - run: rustup update --no-self-update stable - uses: Swatinem/rust-cache@v2 - - - name: emulator integration tests - run: | - npm install azurite@3.13.1 - npx azurite & - cargo test --features test_integration - + - run: eng/scripts/emulator_tests.sh ${{ matrix.build }} - name: display free disk space run: df -h / if: ${{ always() }} @@ -64,10 +90,18 @@ jobs: test-e2e: name: E2E Tests runs-on: ubuntu-20.04 + needs: + - msrv + strategy: + matrix: + build: + - stable + - nightly + - ${{ needs.msrv.outputs.msrv }} steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 - - run: eng/scripts/e2e_tests.sh + - run: eng/scripts/e2e_tests.sh ${{ matrix.build }} - name: display free disk space run: df -h / if: ${{ always() }} @@ -90,4 +124,5 @@ jobs: with: repository: OAI/OpenAPI-Specification path: OpenAPI-Specification + # for code style, we only care about `stable` - run: azure-sdk-for-rust/eng/scripts/autorust_tests.sh diff --git a/eng/scripts/code_style.sh b/eng/scripts/code_style.sh index efa6bf8c0c..a5f827c915 100755 --- a/eng/scripts/code_style.sh +++ b/eng/scripts/code_style.sh @@ -9,6 +9,7 @@ export RUSTDOCFLAGS="-D warnings" export RUSTFLAGS="-Dwarnings" rustup update --no-self-update ${BUILD} +rustup component add rustfmt --toolchain ${BUILD} cargo +${BUILD} install cargo-readme cargo +${BUILD} fmt --all -- --check cargo +${BUILD} clippy --all diff --git a/eng/scripts/emulator_tests.sh b/eng/scripts/emulator_tests.sh new file mode 100755 index 0000000000..082a04b145 --- /dev/null +++ b/eng/scripts/emulator_tests.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -eux -o pipefail +cd $(dirname ${BASH_SOURCE[0]})/../../ + +BUILD=${1:-stable} + +npm install azurite@3.13.1 +npx azurite & + +rustup update --no-self-update ${BUILD} +cargo +${BUILD} test --features test_integration diff --git a/eng/scripts/services_tests.sh b/eng/scripts/services_tests.sh index 8c0bb89f30..6b454aaa1e 100755 --- a/eng/scripts/services_tests.sh +++ b/eng/scripts/services_tests.sh @@ -6,6 +6,7 @@ cd $(dirname ${BASH_SOURCE[0]})/../../ BUILD=${1:-stable} rustup update --no-self-update ${BUILD} +rustup component add rustfmt clippy --toolchain ${BUILD} export RUSTFLAGS="-Dwarnings -Aunreachable-code -Aunused-assignments -Adead-code -Aclippy::new-without-default -Aclippy::unnecessary_to_owned" cargo +${BUILD} check --manifest-path services/Cargo.toml --all cargo +${BUILD} check --manifest-path services/Cargo.toml --examples diff --git a/sdk/core/Cargo.toml b/sdk/core/Cargo.toml index efc0467e03..ba200b0523 100644 --- a/sdk/core/Cargo.toml +++ b/sdk/core/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://docs.rs/azure_core" keywords = ["sdk", "azure", "rest", "iot", "cloud"] categories = ["api-bindings"] edition = "2021" -rust-version = "1.64.0" +rust-version = "1.67.0" [dependencies] async-trait = "0.1" diff --git a/sdk/data_cosmos/Cargo.toml b/sdk/data_cosmos/Cargo.toml index af99132f09..b46509769b 100644 --- a/sdk/data_cosmos/Cargo.toml +++ b/sdk/data_cosmos/Cargo.toml @@ -11,7 +11,6 @@ documentation = "https://docs.rs/azure_data_cosmos" keywords = ["sdk", "azure", "rest", "iot", "cloud"] categories = ["api-bindings"] edition = "2021" -rust-version = "1.64.0" [dependencies] async-trait = "0.1" diff --git a/sdk/data_tables/Cargo.toml b/sdk/data_tables/Cargo.toml index 9f72b8496a..5b43530a0f 100644 --- a/sdk/data_tables/Cargo.toml +++ b/sdk/data_tables/Cargo.toml @@ -11,7 +11,6 @@ documentation = "https://docs.rs/azure_data_tables" keywords = ["sdk", "azure", "storage", "data-tables"] categories = ["api-bindings"] edition = "2021" -rust-version = "1.64.0" [dependencies] azure_core = { path = "../core", version = "0.13" } diff --git a/sdk/iot_hub/Cargo.toml b/sdk/iot_hub/Cargo.toml index 2262d2ce11..ba3b37c35a 100644 --- a/sdk/iot_hub/Cargo.toml +++ b/sdk/iot_hub/Cargo.toml @@ -8,7 +8,6 @@ license = "MIT" repository = "https://github.com/azure/azure-sdk-for-rust" homepage = "https://github.com/azure/azure-sdk-for-rust" documentation = "https://docs.rs/azure_iot_hub" -rust-version = "1.64.0" [dependencies] async-trait = "0.1" diff --git a/sdk/security_keyvault/Cargo.toml b/sdk/security_keyvault/Cargo.toml index 3dddf33572..c2f1bbc2f5 100644 --- a/sdk/security_keyvault/Cargo.toml +++ b/sdk/security_keyvault/Cargo.toml @@ -11,7 +11,6 @@ categories = ["api-bindings"] readme = "README.md" license = "MIT" edition = "2021" -rust-version = "1.64.0" [dependencies] async-trait = "0.1" diff --git a/sdk/storage/Cargo.toml b/sdk/storage/Cargo.toml index bbc793640b..57c73325cf 100644 --- a/sdk/storage/Cargo.toml +++ b/sdk/storage/Cargo.toml @@ -11,7 +11,6 @@ documentation = "https://docs.rs/azure_storage" keywords = ["sdk", "azure", "storage"] categories = ["api-bindings"] edition = "2021" -rust-version = "1.64.0" [dependencies] async-trait = "0.1" diff --git a/sdk/storage_blobs/Cargo.toml b/sdk/storage_blobs/Cargo.toml index 1c960de14f..b40c34cc4f 100644 --- a/sdk/storage_blobs/Cargo.toml +++ b/sdk/storage_blobs/Cargo.toml @@ -11,7 +11,6 @@ documentation = "https://docs.rs/azure_storage_blobs" keywords = ["sdk", "azure", "storage", "blobs"] categories = ["api-bindings"] edition = "2021" -rust-version = "1.64.0" [dependencies] azure_core = { path = "../core", version = "0.13", features = ["xml"] } diff --git a/sdk/storage_datalake/Cargo.toml b/sdk/storage_datalake/Cargo.toml index 3430ae7919..0a4365e22d 100644 --- a/sdk/storage_datalake/Cargo.toml +++ b/sdk/storage_datalake/Cargo.toml @@ -11,7 +11,6 @@ documentation = "https://docs.rs/azure_storage_datalake" keywords = ["sdk", "azure", "storage", "datalake"] categories = ["api-bindings"] edition = "2021" -rust-version = "1.64.0" [dependencies] async-trait = "0.1" diff --git a/sdk/storage_queues/Cargo.toml b/sdk/storage_queues/Cargo.toml index f7b097cf86..c8cc136048 100644 --- a/sdk/storage_queues/Cargo.toml +++ b/sdk/storage_queues/Cargo.toml @@ -11,7 +11,6 @@ documentation = "https://docs.rs/azure_storage_queues" keywords = ["sdk", "azure", "storage", "queues"] categories = ["api-bindings"] edition = "2021" -rust-version = "1.64.0" [dependencies] azure_core = { path = "../core", version = "0.13", default-features=false, features = ["xml"] }