Skip to content

add separate config file for glue #16

add separate config file for glue

add separate config file for glue #16

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.7"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Download dependencies
run: go mod download
- name: Run tests
run: go test ./... -v -race -count=1 -timeout 120s
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.7"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Run tests with coverage
run: go test ./... -coverprofile=coverage.out -covermode=atomic -timeout 120s
- name: Check coverage threshold
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
echo "Total coverage: ${COVERAGE}%"
THRESHOLD=50
if (( $(echo "$COVERAGE < $THRESHOLD" | bc -l) )); then
echo "Coverage ${COVERAGE}% is below threshold ${THRESHOLD}%"
exit 1
fi
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.out
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.7"
- name: Run go vet
run: go vet ./...
- name: Check formatting
run: |
UNFORMATTED=$(gofmt -l .)
if [ -n "$UNFORMATTED" ]; then
echo "The following files are not formatted:"
echo "$UNFORMATTED"
exit 1
fi
- name: Run staticcheck
uses: dominikh/staticcheck-action@v1
with:
version: "latest"
vuln:
name: Vulnerability Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.7"
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run govulncheck
run: govulncheck ./...
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.7"
- name: Build
run: go build ./...
- name: Verify go.mod is tidy
run: |
go mod tidy
git diff --exit-code go.mod go.sum
genconfig:
name: Verify Generated Configs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.7"
- name: Build pbench
run: go build -o pbench
- name: Regenerate cluster configs
run: ./pbench genconfig -p clusters/params.json -t clusters/templates clusters
- name: Check for stale configs
run: |
if ! git diff --exit-code clusters/; then
echo ""
echo "ERROR: Generated cluster configs are out of date."
echo "Run 'make clusters' and commit the results."
exit 1
fi