| 1 | name: ci |
| 2 | on: |
| 3 | push: |
| 4 | branches: [trunk, main] |
| 5 | pull_request: |
| 6 | |
| 7 | permissions: |
| 8 | contents: read |
| 9 | |
| 10 | jobs: |
| 11 | ci: |
| 12 | runs-on: ubuntu-latest |
| 13 | steps: |
| 14 | - uses: actions/checkout@v4 |
| 15 | |
| 16 | - uses: actions/setup-go@v5 |
| 17 | with: |
| 18 | # Read the target Go version straight from go.mod so this |
| 19 | # workflow doesn't drift from the module on every Go bump. |
| 20 | go-version-file: go.mod |
| 21 | cache: true |
| 22 | |
| 23 | - name: Install golangci-lint |
| 24 | # v8 of the action ships with golangci-lint v2 by default, |
| 25 | # which is required to parse our .golangci.yml (version: "2") |
| 26 | # and is built with a Go new enough to load the module. |
| 27 | uses: golangci/golangci-lint-action@v8 |
| 28 | with: |
| 29 | version: latest |
| 30 | args: --timeout=5m |
| 31 | |
| 32 | - name: Test |
| 33 | run: go test -trimpath ./... |
| 34 | |
| 35 | - name: Build |
| 36 | run: go build -trimpath ./cmd/shithubd |
| 37 |