Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secretless build #34

Merged
merged 6 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
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:
toolchain: nightly
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 }}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion azure-kusto-data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion azure-kusto-data/src/cloud_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use azure_core::error::Error as CoreError;
use azure_core::prelude::*;
use azure_core::{Context, Method, Pipeline, Request, StatusCode};

Check warning on line 6 in azure-kusto-data/src/cloud_info.rs

View workflow job for this annotation

GitHub Actions / clippy

the item `Context` is imported redundantly

warning: the item `Context` is imported redundantly --> azure-kusto-data/src/cloud_info.rs:6:18 | 5 | use azure_core::prelude::*; | ---------------------- the item `Context` is already imported here 6 | use azure_core::{Context, Method, Pipeline, Request, StatusCode}; | ^^^^^^^
use futures::lock::Mutex;
use hashbrown::hash_map::EntryRef;
use hashbrown::HashMap;
Expand Down Expand Up @@ -62,7 +62,7 @@
);
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 => {
Expand Down
6 changes: 1 addition & 5 deletions azure-kusto-data/src/operations/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Loading