Skip to content

fix(runner/triggers): dedupe CronJob-run findings, skip agent-managed scan jobs #234

fix(runner/triggers): dedupe CronJob-run findings, skip agent-managed scan jobs

fix(runner/triggers): dedupe CronJob-run findings, skip agent-managed scan jobs #234

name: Runner - Lint and Test
on:
workflow_dispatch:
pull_request:
branches: [main]
paths: ['runner/**']
push:
branches: [main]
paths: ['runner/**']
permissions:
contents: read
jobs:
test:
name: Lint + Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: runner
strategy:
matrix:
go-version: ['1.26.x']
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 0
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: runner/go.sum
- name: gofmt check
run: |
gofmt_diff=$(gofmt -s -l . | grep -v '^vendor/' || true)
if [ -n "$gofmt_diff" ]; then
echo "Files need gofmt -s -w:"
echo "$gofmt_diff"
exit 1
fi
- name: go vet
run: go vet ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9
with:
version: v2.9.0
args: --timeout 10m
working-directory: runner
- name: Unit tests with race detector
run: go test -race -count=1 ./...
- name: Coverage
run: |
go test -race -count=1 \
-coverpkg=$(go list ./pkg/... ./internal/... | grep -v /pkg/version | tr '\n' ',' | sed 's/,$//') \
-coverprofile=coverage.out -covermode=atomic \
./pkg/... ./internal/...
go tool cover -func=coverage.out | tail -1
- name: Upload coverage artefact
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: coverage
path: runner/coverage.out
retention-days: 7