From 1abf9bd05c61c3b7f07552d881c31e200b54c2f2 Mon Sep 17 00:00:00 2001 From: David Osipov Date: Mon, 23 Mar 2026 12:27:57 +0400 Subject: [PATCH] Refactor CI workflows: rename build job and streamline stress testing setup --- .github/workflows/rust.yml | 22 ++++---------- .github/workflows/stress.yml | 57 ++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/stress.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 799f2ce..b245679 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,7 +11,7 @@ env: jobs: build: - name: Build + name: Compile, Test, Lint runs-on: ubuntu-latest permissions: @@ -39,23 +39,11 @@ jobs: restore-keys: | ${{ runner.os }}-cargo- - - name: Build Release - run: cargo build --release --verbose + - name: Compile (no tests) + run: cargo check --workspace --all-features --lib --bins --verbose - - name: Run tests - run: cargo test --verbose - - - name: Stress quota-lock suites (PR only) - if: github.event_name == 'pull_request' - env: - RUST_TEST_THREADS: 16 - run: | - set -euo pipefail - for i in $(seq 1 12); do - echo "[quota-lock-stress] iteration ${i}/12" - cargo test quota_lock_ --bin telemt -- --nocapture --test-threads 16 - cargo test relay_quota_wake --bin telemt -- --nocapture --test-threads 16 - done + - name: Run tests (single pass) + run: cargo test --workspace --all-features --verbose # clippy dont fail on warnings because of active development of telemt # and many warnings diff --git a/.github/workflows/stress.yml b/.github/workflows/stress.yml new file mode 100644 index 0000000..96b9a1b --- /dev/null +++ b/.github/workflows/stress.yml @@ -0,0 +1,57 @@ +name: Stress Tests + +on: + workflow_dispatch: + schedule: + - cron: '0 2 * * *' + pull_request: + branches: ["*"] + paths: + - src/proxy/** + - src/transport/** + - src/stream/** + - src/protocol/** + - src/tls_front/** + - Cargo.toml + - Cargo.lock + +env: + CARGO_TERM_COLOR: always + +jobs: + quota-lock-stress: + name: Quota-lock stress loop + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install latest stable Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo registry and build artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-stress-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-stress- + ${{ runner.os }}-cargo- + + - name: Run quota-lock stress suites + env: + RUST_TEST_THREADS: 16 + run: | + set -euo pipefail + for i in $(seq 1 12); do + echo "[quota-lock-stress] iteration ${i}/12" + cargo test quota_lock_ --bin telemt -- --nocapture --test-threads 16 + cargo test relay_quota_wake --bin telemt -- --nocapture --test-threads 16 + done