# Runs on the containerized act_runner (label: ubuntu-latest). name: CI on: push: branches: [main] pull_request: workflow_dispatch: jobs: go: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version-file: cmd/rollcall/go.mod cache-dependency-path: cmd/rollcall/go.sum cache: true - name: gofmt working-directory: cmd/rollcall run: | out=$(gofmt -l .) if [ -n "$out" ]; then echo "gofmt needed on:"; echo "$out"; exit 1; fi - name: go vet working-directory: cmd/rollcall run: go vet ./... - name: go test working-directory: cmd/rollcall run: go test -race -timeout 5m ./... - name: Build (static, linux/amd64 and linux/arm64) working-directory: cmd/rollcall run: | for arch in amd64 arm64; do CGO_ENABLED=0 GOOS=linux GOARCH=$arch go build -trimpath -ldflags="-s -w" -o rollcall-linux-$arch . done ls -la rollcall-linux-* - uses: actions/upload-artifact@v3 with: name: rollcall-linux-amd64 path: cmd/rollcall/rollcall-linux-amd64 agent: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Python syntax + shell syntax run: | python3 -m py_compile agent/rollcall-agent.py lab/pve-vbmc/pve_vbmc.py for f in agent/build-image.sh deploy/install.sh lab/pve-vbmc/install.sh lab/pve-vbmc/pve-vbmc-addrs.sh; do bash -n "$f" || sh -n "$f" done - name: Config examples are valid JSON run: | python3 -c 'import json,sys; [json.load(open(f)) for f in sys.argv[1:]]' deploy/config.example.json lab/pve-vbmc/config.example.json - name: No secrets committed run: | # the agent token must stay a placeholder in the tracked PXE menu grep -q '@AGENT_TOKEN@' deploy/pxelinux-default ! grep -rEn 'rollcall\.token=[0-9a-f]{16,}' --exclude-dir=.git . || { echo "real agent token committed"; exit 1; } site: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: HTML sanity run: | test -f site/index.html python3 - <<'EOF' from html.parser import HTMLParser class P(HTMLParser): def __init__(self): super().__init__(); self.depth=0 p=P(); p.feed(open('site/index.html').read()); print("ok") EOF