mirror of
https://github.com/telemt/telemt.git
synced 2026-06-19 02:00:08 +07:00
67 lines
1.5 KiB
YAML
67 lines
1.5 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ "*" ]
|
|
pull_request:
|
|
branches: [ "*" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
actions: write
|
|
checks: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install latest stable Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
|
|
- name: Cache cargo registry & build artifacts
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Build Release
|
|
run: cargo build --release --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
|
|
|
|
# clippy dont fail on warnings because of active development of telemt
|
|
# and many warnings
|
|
- name: Run clippy
|
|
run: cargo clippy -- --cap-lints warn
|
|
|
|
- name: Check for unused dependencies
|
|
run: cargo udeps || true
|