Skip to content

Commit d107f92

Browse files
authored
Merge pull request #195 from auths-dev/dev-ciOpsLanOps
build/fix: consolidate CI resources to optimize wall time, fix LAN pairing dropping early
2 parents 37e12df + 243cc73 commit d107f92

4 files changed

Lines changed: 51 additions & 8 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Setup Rust
2+
description: Install Rust toolchain from rust-toolchain.toml and cache cargo artifacts
3+
4+
inputs:
5+
components:
6+
description: Rust components to install (comma-separated)
7+
required: false
8+
default: ""
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- uses: dtolnay/rust-toolchain@master
14+
with:
15+
toolchain: "1.93"
16+
components: ${{ inputs.components }}
17+
- uses: actions/cache@v4
18+
with:
19+
path: |
20+
~/.cargo/registry
21+
~/.cargo/git
22+
~/.cargo/bin
23+
target
24+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
25+
restore-keys: ${{ runner.os }}-cargo-

‎.github/workflows/cargo-deny.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ jobs:
2424
- bans licenses sources
2525
steps:
2626
- uses: actions/checkout@v4
27-
- uses: dtolnay/rust-toolchain@master
28-
with:
29-
toolchain: "1.93"
27+
- uses: ./.github/actions/setup-rust
3028
- name: Install cargo-deny
31-
run: cargo install cargo-deny --version "=0.19.0" --locked
29+
run: |
30+
if ! cargo deny --version 2>/dev/null | grep -q "0.19"; then
31+
cargo install cargo-deny --locked
32+
fi
3233
- name: cargo deny check ${{ matrix.checks }}
3334
run: cargo deny --manifest-path ./Cargo.toml check ${{ matrix.checks }}
3435

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ jobs:
5353
- run: cargo clippy --all-targets --all-features -- -D warnings
5454
- run: cargo run -p xtask -- check-clippy-sync
5555

56+
xtask-checks:
57+
name: Tree-sitter enforcement
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: ./.github/actions/setup-rust
62+
- name: Run tree-sitter enforcement checks
63+
run: |
64+
cargo run -p xtask -- check-curve-agnostic
65+
cargo run -p xtask -- check-anchor-discipline
66+
cargo run -p xtask -- check-constant-time
67+
cargo run -p xtask -- check-rfc6979
68+
5669
schemas:
5770
name: Schema validation
5871
runs-on: ubuntu-latest

‎crates/auths-cli/src/commands/device/pair/lan_server.rs‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,18 @@ impl LanPairingServer {
104104
self,
105105
timeout: Duration,
106106
) -> Result<SubmitResponseRequest, auths_sdk::error::PairingError> {
107-
self.cancel.cancel();
108-
109-
self.handle
107+
let result = self
108+
.handle
110109
.wait_for_response(timeout)
111110
.await
112111
.map_err(|e| match e {
113112
auths_pairing_daemon::DaemonError::Pairing(pe) => pe,
114113
other => auths_sdk::error::PairingError::LocalServerError(other.to_string()),
115-
})
114+
});
115+
116+
// Shut down the server AFTER response received (or timeout).
117+
// Previously cancel() fired first, killing the listener immediately.
118+
self.cancel.cancel();
119+
result
116120
}
117121
}

0 commit comments

Comments
 (0)