diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58d178a..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 @@ -24,6 +33,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 +41,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 +50,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 +58,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 +67,7 @@ jobs: build: name: 'Build & Test' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master steps: - uses: actions/checkout@v4 @@ -69,9 +75,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 @@ -79,3 +82,58 @@ jobs: uses: actions-rs/cargo@v1 with: command: test + + feature-checks: + name: 'Check feature flag' + runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master + + strategy: + matrix: + feature: + - http + - ipc + - cli + - config+all + - config+json + - config+yaml + - config+toml + - config+corn + - config+ron + - cairo + - clipboard + - clock + - custom + - focused + - 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 + + - uses: Swatinem/rust-cache@v2 + name: Cache dependencies + + - 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 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..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 @@ -13,6 +18,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 +26,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 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: