1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CI
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
os:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy -- -W clippy::all
- name: Build
run: cargo build --release
- name: Test
run: cargo test
# Nothing built the flake, so it silently rotted: the version was
# pinned five releases behind and `src` was dragging `target/` into
# the store. Cheap Linux-only job to keep both honest.
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Flake check
run: nix flake check --all-systems
- name: Build
run: nix build .#syswatch --print-build-logs
- name: Version matches Cargo.toml
run: |
cargo_version=$(nix eval --raw --impure --expr \
'(builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version')
built=$(nix eval --raw .#syswatch.version)
echo "Cargo.toml=$cargo_version package.nix=$built"
test "$cargo_version" = "$built"