Merge pull request #34 from Azure/secretless
This commit is contained in:
Коммит
f9fa5c2ff8
|
@ -1,23 +1,30 @@
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ 'master' ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ '**' ]
|
||||||
|
|
||||||
name: Rust Build, Test, and Lint
|
name: Rust Build, Test, and Lint
|
||||||
|
permissions:
|
||||||
|
checks: write
|
||||||
|
pull-requests: write
|
||||||
|
id-token: write
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-data:
|
build-data:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
environment: build
|
||||||
checks: write
|
|
||||||
pull-requests: write
|
|
||||||
environment: sdke2e
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
RUST_LOG: debug
|
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:
|
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/checkout@v1
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
@ -25,9 +32,7 @@ jobs:
|
||||||
override: true
|
override: true
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- uses: mbrobbel/rustfmt-check@master
|
- run: cargo fmt --all -- --check
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- uses: actions-rs/clippy-check@v1
|
- uses: actions-rs/clippy-check@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -47,6 +52,8 @@ jobs:
|
||||||
CARGO_INCREMENTAL: '0'
|
CARGO_INCREMENTAL: '0'
|
||||||
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
|
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'
|
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
|
- uses: actions-rs/grcov@v0.1
|
||||||
id: coverage
|
id: coverage
|
||||||
- name: Publish Unit Test Results
|
- name: Publish Unit Test Results
|
||||||
|
|
|
@ -44,7 +44,7 @@ once_cell = "1"
|
||||||
arrow = { version = "50.0.0", features = ["prettyprint"] }
|
arrow = { version = "50.0.0", features = ["prettyprint"] }
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
env_logger = "0.10.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"
|
oauth2 = "4.3.0"
|
||||||
criterion = "0.5"
|
criterion = "0.5"
|
||||||
clap = { version = "4.1.6", features = ["derive", "env"] }
|
clap = { version = "4.1.6", features = ["derive", "env"] }
|
||||||
|
|
|
@ -62,7 +62,7 @@ impl CloudInfo {
|
||||||
);
|
);
|
||||||
request.insert_headers(&Accept::from("application/json"));
|
request.insert_headers(&Accept::from("application/json"));
|
||||||
request.insert_headers(&AcceptEncoding::from("gzip, deflate"));
|
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();
|
let (status_code, _header_map, pinned_stream) = response.deconstruct();
|
||||||
match status_code {
|
match status_code {
|
||||||
StatusCode::Ok => {
|
StatusCode::Ok => {
|
||||||
|
|
|
@ -77,11 +77,7 @@ impl QueryRunner {
|
||||||
let bytes = bytes::Bytes::from(serde_json::to_string(&body)?);
|
let bytes = bytes::Bytes::from(serde_json::to_string(&body)?);
|
||||||
request.set_body(bytes);
|
request.set_body(bytes);
|
||||||
|
|
||||||
let response = self
|
let response = self.client.pipeline().send(&context, &mut request).await?;
|
||||||
.client
|
|
||||||
.pipeline()
|
|
||||||
.send(&mut context, &mut request)
|
|
||||||
.await?;
|
|
||||||
Ok(response)
|
Ok(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче