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
name: CI
on:
push:
branches:
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the toolchain
run: rustup toolchain install stable --profile minimal --component rustfmt,clippy
- uses: Swatinem/rust-cache@v2
- name: Formatting
run: cargo fmt --check
- name: Lints
run: cargo clippy --all-targets -- -D warnings
# Spawns the real binary for the MCP and CLI integration tests, so the
# binary has to exist before they run.
- name: Tests
run: cargo test --all-targets
# The published site is hand-written HTML, so a renamed section id would
# otherwise break its own table of contents silently.
- name: Documentation site links
run: .github/scripts/check-docs-links.sh
# The examples are part of the documentation; a broken one misleads.
- name: Example scripts
env:
HIRD_BIN: ${{ github.workspace }}/target/debug/hird
run: |
bash -n examples/*.sh examples/lib/*.sh examples/harness/*.sh
./examples/manual-dispatch.sh
./examples/swarm-plan.sh
./examples/dispatch-hook.sh
./examples/events.sh
# install.sh is exercised end to end by tests/install_script.rs, but
# get.sh downloads from a live release, so a syntax pass and shellcheck
# are what CI can honestly check it with.
- name: Installer scripts
run: |
bash -n scripts/install.sh
sh -n scripts/get.sh
shellcheck scripts/install.sh scripts/get.sh
# The herdr plugin has no build step, so nothing else would catch a
# syntax error in it before somebody's pane opens on one. Checked as
# POSIX sh, which is what the manifest asks herdr to run them with;
# --source-path lets it follow the `. lib.sh` both entry points do.
- name: herdr plugin scripts
run: |
sh -n herdr-plugin/*.sh
shellcheck --shell=sh --source-path=SCRIPTDIR \
herdr-plugin/*.sh .github/scripts/check-herdr-plugin.sh
.github/scripts/check-herdr-plugin.sh