main pico.sh
Eric Bower  ·  2026-08-09
 1#!/usr/bin/env bash
 2set -euo pipefail
 3
 4export ZMX_SESSION_PREFIX="${ZMX_SESSION_PREFIX:-ci.pici.}"
 5JOB_ID="${PICI_JOB:-local}"
 6REPO="${PICI_REPO:-pici}"
 7EVENT_TYPE="${PICI_EVENT:-manual}"
 8
 9printf "\x1b[33m[%s:%s] running ci (event=%s)\x1b[0m\n" "$REPO" "$JOB_ID" "$EVENT_TYPE"
10
11zmx run fmt -d docker run -t --rm -v "$(pwd):/app" -w /app golang:1.26 bash -c 'files=$(gofmt -l .); if [ -n "$files" ]; then echo "unformatted files:"; echo "$files"; exit 1; fi'
12zmx run lint -d docker run -t --rm -v "$(pwd):/app" -w /app golangci/golangci-lint:v2.11.4 golangci-lint run
13zmx run test -d docker run -t --rm -v "$(pwd):/app" -w /app golang:1.26 go test ./...
14zmx wait "*"
15
16printf "\x1b[32m[%s:%s] success!\x1b[0m\n" "$REPO" "$JOB_ID"