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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: test
# Mirrors shep-log-rotate's workflow in shape, one dog crate to another. shep
# itself runs twelve jobs across five platforms because it ships a daemon;
# this ships one binary that talks to one, so most of that matrix would be
# spending minutes to learn nothing.
#
# The `integration` job is the exception and the reason this file exists at
# all. Every other job here would pass on a dog that cannot actually talk to
# a shepherd.
on:
push:
branches:
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal --component clippy,rustfmt
- run: cargo fmt --all -- --check
# `--all-targets` reaches the integration tier's own source, which is
# feature-gated off by default and would otherwise go unlinted until
# somebody enabled it.
- run: cargo clippy --all-targets --all-features -- -D warnings
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
test:
strategy:
fail-fast: false
matrix:
os:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- run: cargo test --locked
# Both platforms, because this dog is filesystem code (worktrees,
# atomic swaps, shared-file links) and the two disagree about things it
# depends on.
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Matches `rust-version` in Cargo.toml, which matches shep's. A dog
# that needs a newer compiler than the daemon it serves is a bad
# example.
- run: rustup toolchain install 1.88 --profile minimal
- run: cargo +1.88 check --all-targets --all-features --locked
integration:
# The tier that drives a real shepherd, and the only job that tests what
# this project is for. It is feature-gated off by default because a
# fresh clone has no `shep` binary; here we install one.
#
# shep publishes to crates.io as of its 0.1.0 release, so this installs
# from the registry rather than from a git branch. That means a red job
# here is a real signal against shep's current published surface, not
# against whatever `main` happens to look like on a given day.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- name: Build a real shep
run: cargo install shep --locked
- name: Run the integration tier against it
run: SHEP_BIN="$(command -v shep)" cargo test --features integration --locked