From 75301868decdfc48f98576fb5353761341e6b460 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Wed, 16 Apr 2025 22:46:58 +0100 Subject: [PATCH 1/3] ci(build): check each feature individually --- .github/workflows/build.yml | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58d178a..5ab457b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,3 +79,55 @@ jobs: uses: actions-rs/cargo@v1 with: command: test + + feature-checks: + name: 'Check feature flag' + runs-on: ubuntu-latest + + strategy: + matrix: + feature: + - http + - ipc + - cli + - config+all + - config+json + - config+yaml + - config+toml + - config+corn + - config+ron + - cairo + - clipboard + - clock + - custom + - focused + - keyboard + - keyboard+all + - keyboard+sway + - keyboard+hyprland + - label + - launcher + - music+all + - music+mpris + - music+mpd + - network_manager + - notifications + - sys_info + - script + - tray + - upower + - volume + - workspaces+all + - workspaces+sway + - workspaces+hyprland + - workspaces+niri + - schema + + steps: + - uses: actions/checkout@v4 + + - name: Check + run: cargo check --no-default-features --features ${{ matrix.feature }} + env: + # Allow some warnings through as we'll never get it perfect + RUSTFLAGS: '-A unused-imports -A unused-variables -A unused-mut -A dead-code' \ No newline at end of file From e46fdce14cd761b81104fedfeb9c5ded649e398d Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Wed, 16 Apr 2025 23:21:14 +0100 Subject: [PATCH 2/3] ci: use custom build image --- .github/workflows/build.yml | 16 +++++++--------- .github/workflows/deploy.yml | 8 ++------ .github/workflows/schema.yml | 4 +--- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ab457b..eb95279 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,7 @@ jobs: clippy-base: runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master name: 'Clippy (Base features)' steps: - uses: actions/checkout@v4 @@ -31,9 +32,6 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Clippy run: cargo clippy --no-default-features --features config+json env: @@ -43,6 +41,7 @@ jobs: clippy-all: runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master name: 'Clippy (All features)' steps: - uses: actions/checkout@v4 @@ -50,9 +49,6 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Clippy run: cargo clippy --all-targets --all-features env: @@ -62,6 +58,7 @@ jobs: build: name: 'Build & Test' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master steps: - uses: actions/checkout@v4 @@ -69,9 +66,6 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Build run: cargo build --verbose @@ -83,6 +77,7 @@ jobs: feature-checks: name: 'Check feature flag' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master strategy: matrix: @@ -126,6 +121,9 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + name: Cache dependencies + - name: Check run: cargo check --no-default-features --features ${{ matrix.feature }} env: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1e81950..5205a24 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -41,6 +41,7 @@ jobs: publish-crate: name: 'Publish Crate' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master steps: - uses: actions/checkout@v3 @@ -50,9 +51,6 @@ jobs: toolchain: stable override: true - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Publish crate uses: katyo/publish-crates@v1 with: @@ -62,6 +60,7 @@ jobs: publish-schema: name: 'Publish Schema' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master steps: - uses: actions/checkout@v3 @@ -69,9 +68,6 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Ensure target folder run: mkdir -p target diff --git a/.github/workflows/schema.yml b/.github/workflows/schema.yml index be79ca2..1ca598b 100644 --- a/.github/workflows/schema.yml +++ b/.github/workflows/schema.yml @@ -13,6 +13,7 @@ jobs: publish-schema: name: 'Publish Schema' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master steps: - uses: actions/checkout@v3 @@ -20,9 +21,6 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Build run: cargo build --features schema From 4aff6bcbbcdcee9b38231292642d288dc74303ad Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Wed, 16 Apr 2025 23:39:30 +0100 Subject: [PATCH 3/3] ci: restrict trigger paths this should hopefully reduce unnecessary job runs --- .github/workflows/build.yml | 10 +++++++++- .github/workflows/schema.yml | 5 +++++ .github/workflows/wiki.yml | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb95279..bf814d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,8 +4,17 @@ on: workflow_dispatch: push: branches: [ "master" ] + paths: + - 'src' + - 'Cargo.*' + - 'build.rs' pull_request: branches: [ "master" ] + paths: + - 'src' + - 'Cargo.*' + - 'build.rs' + - '.github/workflows/build.yml' env: CARGO_TERM_COLOR: always @@ -96,7 +105,6 @@ jobs: - clock - custom - focused - - keyboard - keyboard+all - keyboard+sway - keyboard+hyprland diff --git a/.github/workflows/schema.yml b/.github/workflows/schema.yml index 1ca598b..18829db 100644 --- a/.github/workflows/schema.yml +++ b/.github/workflows/schema.yml @@ -4,6 +4,11 @@ on: workflow_dispatch: push: branches: [ "master" ] + paths: + - 'src' + - 'Cargo.*' + - 'build.rs' + - '.github/workflows/schema.yml.yml' env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml index 0dd4a70..d8af194 100644 --- a/.github/workflows/wiki.yml +++ b/.github/workflows/wiki.yml @@ -3,6 +3,8 @@ name: Sync Wiki on: push: branches: [ "master" ] + paths: + - 'docs' jobs: build: