From 3038c29c57833ce1886227c4299338ba76e02485 Mon Sep 17 00:00:00 2001 From: Jory Severijnse Date: Tue, 17 Mar 2026 20:07:34 +0100 Subject: [PATCH] refactor(ci): extract system deps to reusable action --- .github/actions/deps/action.yml | 17 +++++++++++++++++ .github/workflows/metrics.yml | 14 +++----------- .github/workflows/quality.yml | 10 +--------- 3 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 .github/actions/deps/action.yml diff --git a/.github/actions/deps/action.yml b/.github/actions/deps/action.yml new file mode 100644 index 0000000..6f73561 --- /dev/null +++ b/.github/actions/deps/action.yml @@ -0,0 +1,17 @@ +name: Install system dependencies +description: Install system dependencies required for building rustlock + +runs: + using: composite + steps: + - name: Install system dependencies (Ubuntu/Debian) + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y \ + curl \ + llvm clang libclang-dev \ + pkg-config \ + libglib2.0-dev libcairo2-dev libpango1.0-dev libatk1.0-dev \ + libgdk-pixbuf-2.0-dev libpam0g-dev libdbus-1-dev \ + libwayland-dev libxkbcommon-dev diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index 091482e..27b8af3 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -21,6 +21,8 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 + - uses: ./.github/actions/deps + - name: Install Rust uses: dtolnay/rust-toolchain@stable @@ -52,17 +54,7 @@ jobs: path: loc.json retention-days: 30 - - name: Check compile times - run: | - echo "=== Compilation Metrics ===" - echo "Note: For accurate compile times, run: cargo clean && cargo build --timings" - echo "" - echo "To optimize compile times:" - echo "1. Check for large dependencies with: cargo tree --depth 1" - echo "2. Consider feature flag optimization" - echo "3. Review workspace structure" - - - name: Dependency analysis + - name: Generate dependency graph run: | cargo install cargo-depgraph cargo depgraph --all-features --dedup-transitive --format dot > deps.dot diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index a8e0b59..11dee2a 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -17,15 +17,7 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - llvm clang libclang-dev \ - pkg-config \ - libglib2.0-dev libcairo2-dev libpango1.0-dev libatk1.0-dev \ - libpam0g-dev libdbus-1-dev \ - libwayland-dev libxkbcommon-dev + - uses: ./.github/actions/deps - name: Install Rust with tools uses: dtolnay/rust-toolchain@stable