diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b74cb50..d31de3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,23 +1,30 @@ -on: [push] +on: + push: + branches: [ 'master' ] + pull_request: + branches: [ '**' ] name: Rust Build, Test, and Lint +permissions: + checks: write + pull-requests: write + id-token: write + contents: read jobs: build-data: runs-on: ubuntu-latest - permissions: - checks: write - pull-requests: write - environment: sdke2e + environment: build env: RUST_BACKTRACE: 1 RUST_LOG: debug - KUSTO_CLUSTER_URL: https://sdkse2etest.eastus.kusto.windows.net - KUSTO_DATABASE: fastbatchinge2e - AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} steps: + - name: Azure login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 with: @@ -25,9 +32,7 @@ jobs: override: true components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - - uses: mbrobbel/rustfmt-check@master - with: - token: ${{ secrets.GITHUB_TOKEN }} + - run: cargo fmt --all -- --check - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -47,6 +52,8 @@ jobs: CARGO_INCREMENTAL: '0' RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + KUSTO_CLUSTER_URL: https://sdkse2etest.eastus.kusto.windows.net + KUSTO_DATABASE: fastbatchinge2e - uses: actions-rs/grcov@v0.1 id: coverage - name: Publish Unit Test Results diff --git a/azure-kusto-data/Cargo.toml b/azure-kusto-data/Cargo.toml index 4366ad6..0f89f4c 100644 --- a/azure-kusto-data/Cargo.toml +++ b/azure-kusto-data/Cargo.toml @@ -44,7 +44,7 @@ once_cell = "1" arrow = { version = "50.0.0", features = ["prettyprint"] } dotenv = "0.15.0" env_logger = "0.10.0" -tokio = { version = "1.25.0", features = ["macros"] } +tokio = { version = "1.25.0", features = ["macros", "rt-multi-thread"] } oauth2 = "4.3.0" criterion = "0.5" clap = { version = "4.1.6", features = ["derive", "env"] } diff --git a/azure-kusto-data/src/cloud_info.rs b/azure-kusto-data/src/cloud_info.rs index 2abfcc9..ad7baeb 100644 --- a/azure-kusto-data/src/cloud_info.rs +++ b/azure-kusto-data/src/cloud_info.rs @@ -62,7 +62,7 @@ impl CloudInfo { ); request.insert_headers(&Accept::from("application/json")); request.insert_headers(&AcceptEncoding::from("gzip, deflate")); - let response = pipeline.send(&mut Context::new(), &mut request).await?; + let response = pipeline.send(&Context::new(), &mut request).await?; let (status_code, _header_map, pinned_stream) = response.deconstruct(); match status_code { StatusCode::Ok => { diff --git a/azure-kusto-data/src/operations/query.rs b/azure-kusto-data/src/operations/query.rs index 0d7ee4a..20da6a3 100644 --- a/azure-kusto-data/src/operations/query.rs +++ b/azure-kusto-data/src/operations/query.rs @@ -77,11 +77,7 @@ impl QueryRunner { let bytes = bytes::Bytes::from(serde_json::to_string(&body)?); request.set_body(bytes); - let response = self - .client - .pipeline() - .send(&mut context, &mut request) - .await?; + let response = self.client.pipeline().send(&context, &mut request).await?; Ok(response) }