From 7d67d8e8a8a55914082491e902f665483c574792 Mon Sep 17 00:00:00 2001 From: Aleksey Vasilenko Date: Tue, 4 Feb 2025 13:09:40 +0200 Subject: [PATCH] Clean-up and unify CI workflows --- .github/workflows/hygiene.yml | 44 ------------------------------- .github/workflows/testing.yml | 49 +++++++++++++---------------------- 2 files changed, 18 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/hygiene.yml diff --git a/.github/workflows/hygiene.yml b/.github/workflows/hygiene.yml deleted file mode 100644 index 0905853..0000000 --- a/.github/workflows/hygiene.yml +++ /dev/null @@ -1,44 +0,0 @@ -on: [push, pull_request] - -name: "Code Hygiene Suite" - -env: - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse - -jobs: - hygiene: - strategy: - matrix: - platform: [macos-latest, ubuntu-20.04, windows-latest] - - runs-on: ${{ matrix.platform }} - - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - name: Install dependencies (Ubuntu only) - if: matrix.platform == 'ubuntu-20.04' - run: | - sudo apt-get update - sudo apt-get install -y libdbus-1-dev pkg-config - - - name: rust toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Initialize Rust Cache - uses: actions/cache@v4 - with: - path: | - ~/target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: cargo check - run: cargo check - - - name: cargo fmt - run: cargo fmt --all -- --check - - - name: cargo clippy - run: cargo clippy -- -D warnings diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index d627036..8b0620f 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,41 +1,28 @@ -name: "Testing Suite" +name: "Testing" on: [push, pull_request] jobs: - unit-test: - permissions: - contents: write + test: strategy: matrix: - platform: [macos-latest, ubuntu-20.04, windows-latest] - - runs-on: ${{ matrix.platform }} + os: [macos-latest, ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: submodules: true - - - name: Initialize Rust Cache - uses: actions/cache@v4 - with: - path: | - ~/target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - - - name: Install Rust stable - uses: dtolnay/rust-toolchain@stable - + - name: Init cache + uses: Swatinem/rust-cache@v2 - name: Install dependencies (Ubuntu only) - if: matrix.platform == 'ubuntu-20.04' + if: matrix.os == 'ubuntu-latest' run: | - sudo apt-get update - sudo apt-get install -y libdbus-1-dev pkg-config - - - name: Run test suite - working-directory: ./ - run: cargo test --features ts-gen + sudo apt-get install -y libdbus-1-dev + - name: cargo check + run: cargo check + - name: cargo fmt + run: cargo fmt --all -- --check + - name: cargo clippy + run: cargo clippy -- -D warnings + - name: cargo test + run: cargo test --all-features