Merge pull request #34 from Azure/secretless

This commit is contained in:
AsafMah 2024-04-11 10:53:00 +03:00 коммит произвёл GitHub
Родитель d96d233841 b5d5acfa6e
Коммит f9fa5c2ff8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 23 добавлений и 20 удалений

33
.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

Просмотреть файл

@ -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"] }

Просмотреть файл

@ -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 => {

Просмотреть файл

@ -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)
}