Skip to content

chore: simplify repository file rules #85

chore: simplify repository file rules

chore: simplify repository file rules #85

Workflow file for this run

name: Lint
permissions:
contents: read
on:
workflow_dispatch:
push:
branches: [master]
pull_request:
branches: [master]
concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.26.x"
- name: Verify modules
run: |
go mod download
go mod verify
- name: gofmt
run: |
$unfmt = (gofmt -l .)
if ($unfmt) { Write-Error "gofmt: $unfmt"; exit 1 }
- name: go test
run: go test -count=1 ./...
- name: go test (devtools)
run: go test -count=1 -tags devtools ./...
- name: go test (tools)
run: go test -count=1 -tags tools ./...
- name: Build supported Windows architectures
run: |
$env:CGO_ENABLED = "0"
$ldflags = "-s -w -H windowsgui -X github.com/JeffioZ/idletrigger/internal/version.Value=ci"
foreach ($arch in @("386", "amd64")) {
$env:GOARCH = $arch
go build -trimpath -ldflags $ldflags -o (Join-Path $env:RUNNER_TEMP "IdleTrigger-$arch.exe") ./cmd/idletrigger
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
- name: go vet
run: go vet ./...
- name: go vet (devtools)
run: go vet -tags devtools ./...
- name: Verify build dependency boundaries
run: ./tools/check-build-boundaries.ps1
- name: govulncheck
run: go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9
with:
version: v2.11.4
args: --timeout=5m --disable=errcheck