mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-01 10:41:03 +02:00
Merge pull request #471 from JakeStanger/ci/build-changes
Rewrite CI build workflow
This commit is contained in:
commit
39cb35b59d
2 changed files with 53 additions and 45 deletions
95
.github/workflows/build.yml
vendored
95
.github/workflows/build.yml
vendored
|
@ -9,18 +9,24 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
RUSTFLAGS: '-Dwarnings'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
rustfmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
name: 'Formatting'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- name: Check formatting
|
||||||
with:
|
run: cargo fmt --check
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
|
clippy-base:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: 'Clippy (Base features)'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
name: Cache dependencies
|
name: Cache dependencies
|
||||||
|
@ -30,20 +36,45 @@ jobs:
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install libgtk-3-dev libgtk-layer-shell-dev
|
sudo apt-get install libgtk-3-dev libgtk-layer-shell-dev
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Clippy
|
||||||
run: cargo fmt --check
|
run: cargo clippy --no-default-features --features config+json
|
||||||
|
env:
|
||||||
|
# Allow some warnings through as we'll never get it perfect in a zero-feature situation
|
||||||
|
RUSTFLAGS: '-A unused-imports -A unused-variables -A unused-mut -A dead-code'
|
||||||
|
|
||||||
- name: Clippy (base features)
|
|
||||||
uses: actions-rs/clippy-check@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
args: --no-default-features --features config+json
|
|
||||||
|
|
||||||
- name: Clippy (all features)
|
clippy-all:
|
||||||
uses: actions-rs/clippy-check@v1
|
runs-on: ubuntu-latest
|
||||||
with:
|
name: 'Clippy (All features)'
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
steps:
|
||||||
args: --all-features
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
name: Cache dependencies
|
||||||
|
|
||||||
|
- name: Install build deps
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install libgtk-3-dev libgtk-layer-shell-dev
|
||||||
|
|
||||||
|
- name: Clippy
|
||||||
|
run: cargo clippy --all-targets --all-features
|
||||||
|
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: 'Build & Test'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
name: Cache dependencies
|
||||||
|
|
||||||
|
- name: Install build deps
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install libgtk-3-dev libgtk-layer-shell-dev
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --verbose
|
run: cargo build --verbose
|
||||||
|
@ -51,28 +82,4 @@ jobs:
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
build-nix:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@v20
|
|
||||||
with:
|
|
||||||
install_url: https://nixos.org/nix/install
|
|
||||||
extra_nix_config: |
|
|
||||||
auto-optimise-store = true
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
|
|
||||||
- uses: cachix/cachix-action@v12
|
|
||||||
with:
|
|
||||||
name: jakestanger
|
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
|
||||||
|
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
||||||
|
|
||||||
- run: nix build --print-build-logs
|
|
|
@ -127,7 +127,8 @@ A flake is included with the repo which can be used with Home Manager.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
There is a Cachix cache available at `https://app.cachix.org/cache/jakestanger`.
|
CI builds are automatically cached by Garnix.
|
||||||
|
You can use their binary cache by following the steps [here](https://garnix.io/docs/caching).
|
||||||
|
|
||||||
### Source
|
### Source
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue