-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR standardizes where all crates set the MSRV (`azure_core`), as well as updates the actions to build on a matrix of 'stable', 'nightly', and the rust-version set in `azure_core`. This allows developers of the SDK to run each of the build tasks exactly as they are run in CICD with minimal configuration.
- Loading branch information
Showing
13 changed files
with
61 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,41 +50,58 @@ 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() }} | ||
|
||
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 [email protected] | ||
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() }} | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -eux -o pipefail | ||
cd $(dirname ${BASH_SOURCE[0]})/../../ | ||
|
||
BUILD=${1:-stable} | ||
|
||
npm install [email protected] | ||
npx azurite & | ||
|
||
rustup update --no-self-update ${BUILD} | ||
cargo +${BUILD} test --features test_integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters