diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 42fd8d6..664e5fb 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,13 +14,27 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: + - name: Checkout code + uses: actions/checkout@v7 - name: Install Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v7 with: go-version: ${{ matrix.go-version }} - - name: Checkout code - uses: actions/checkout@v4 - name: Build run: go build -v ./... - name: Test run: go test -v ./... + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v7 + - name: Install Go + uses: actions/setup-go@v7 + with: + go-version: stable + - name: golangci-lint + uses: golangci/golangci-lint-action@v9 + with: + version: v2.15.0 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 7b16604..2c0d49f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,12 +1,9 @@ -# This is an example .goreleaser.yml file with some sensible defaults. # Make sure to check the documentation at https://goreleaser.com +version: 2 project_name: github_status before: hooks: - # You may remove this if you don't use go modules. - go mod tidy - # you may remove this if you don't need go generate - - go generate ./... builds: - env: - CGO_ENABLED=0 @@ -28,7 +25,7 @@ universal_binaries: checksum: name_template: 'checksums.txt' snapshot: - name_template: "{{ incpatch .Version }}-next" + version_template: "{{ incpatch .Version }}-next" changelog: sort: asc filters: diff --git a/TODO.md b/TODO.md index f3f9a37..f9bc1a8 100644 --- a/TODO.md +++ b/TODO.md @@ -9,10 +9,10 @@ - [x] `linters-settings` should be `linters.settings` - [x] goimports settings go under `formatters.settings.goimports.local-prefixes` (list) - [x] `issues.exclude-dirs` should be `linters.exclusions.paths` -- [ ] Fix `.goreleaser.yaml`. It fails `goreleaser check`: - - [ ] Add `version: 2` - - [ ] `snapshot.name_template` should be `snapshot.version_template` - - [ ] Remove the no-op `go generate ./...` hook +- [x] Fix `.goreleaser.yaml`. It fails `goreleaser check`: + - [x] Add `version: 2` + - [x] `snapshot.name_template` should be `snapshot.version_template` + - [x] Remove the no-op `go generate ./...` hook - [x] HTTP handling in `github_status.go`: - [x] Use an `http.Client` with a timeout instead of `http.Get` - [x] Close `response.Body` @@ -36,11 +36,11 @@ - [x] Split into `fetch(url)` and `render(w io.Writer, summary)`; test `render` with a JSON fixture and `fetch` with `httptest.NewServer` -- [ ] Add a lint job (`golangci/golangci-lint-action`) to CI +- [x] Add a lint job (`golangci/golangci-lint-action`) to CI - [x] CI targets Go `oldstable` and `stable` (via `actions/setup-go` aliases) - [x] Raise `go.mod` to `go 1.26` to match the oldest Go version CI tests -- [ ] Bump `actions/setup-go` / `actions/checkout` -- [ ] Update dependencies (`go get -u ./... && go mod tidy`); `x/sys` v0.25.0 → v0.50.0, +- [x] Bump `actions/setup-go` / `actions/checkout` +- [x] Update dependencies (`go get -u ./... && go mod tidy`); `x/sys` v0.25.0 → v0.50.0, `fatih/color` v1.18.0 → v1.19.0 ## Housekeeping diff --git a/go.mod b/go.mod index ba00820..3e9215b 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/mikemadden42/github_status -go 1.26 +go 1.26.0 -require github.com/fatih/color v1.18.0 +require github.com/fatih/color v1.19.0 require ( - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - golang.org/x/sys v0.25.0 // indirect + github.com/mattn/go-colorable v0.1.16 // indirect + github.com/mattn/go-isatty v0.0.24 // indirect + golang.org/x/sys v0.50.0 // indirect ) diff --git a/go.sum b/go.sum index 33148a4..3edffa7 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,8 @@ -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= +github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= +github.com/mattn/go-colorable v0.1.16 h1:+2YjeAe7xP1OQbZW1jERPWWCDLlNqFNCvjiqGiAt84A= +github.com/mattn/go-colorable v0.1.16/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= +github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= +golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=