Skip to content

Commit

Permalink
Tweak GitHub Action setup
Browse files Browse the repository at this point in the history
Remove unnecessary Go builds from workflows.

Make sure to run more checks with `golangci-lint`.

Use `stable` for Go version to have the latest always.
  • Loading branch information
HeavyWombat committed Jan 1, 2025
1 parent cd7ffdc commit c7d6c7d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 57 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/build.yml

This file was deleted.

14 changes: 6 additions & 8 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ on:
- main

jobs:
build:
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Build source code
run: go build ./...
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/misspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x
go-version: stable

- name: Check out code into the Go module directory
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x
go-version: stable

- name: Run GoReleaser Build
uses: goreleaser/goreleaser-action@v6
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@ jobs:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Build
run: go build ./...
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: Test
run: |
make test
run: make test

- name: Upload Code Coverage Profile
uses: codecov/codecov-action@v5
Expand Down
5 changes: 5 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
linters:
enable:
- gosec
- gocritic
2 changes: 1 addition & 1 deletion internal/img/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (s *Scaffold) image() (image.Image, error) {
w, h := dc.MeasureString(str)

// background color
switch cr.Settings & 0x02 {
switch cr.Settings & 0x02 { //nolint:gocritic
case 2:
dc.SetRGB255(
int((cr.Settings>>32)&0xFF), // #nosec G115
Expand Down
2 changes: 1 addition & 1 deletion internal/ptexec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func RunCommandInPseudoTerminal(name string, args ...string) ([]byte, error) {
func copy(dst io.Writer, src io.Reader) error {
_, err := io.Copy(dst, src)
if err != nil {
switch terr := err.(type) {
switch terr := err.(type) { //nolint:gocritic
case *os.PathError:
// Workaround for issue https://github.com/creack/pty/issues/100
// where on Linux systems it can happen that the pseudo terminal
Expand Down

0 comments on commit c7d6c7d

Please sign in to comment.