Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: ["1.22.x", "1.23.x"]
go: ["1.27.x"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Verify modules are tidy
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.23.x'
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.27.x'
run: |
go mod tidy
git diff --exit-code -- go.mod go.sum
Expand All @@ -42,8 +42,8 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: go test -race ./...
- name: Upload coverage
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.23.x'
uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.27.x'
uses: codecov/codecov-action@v7
with:
files: coverage.txt
fail_ci_if_error: false
Expand All @@ -53,11 +53,11 @@ jobs:
vuln:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.23.x"
go-version: "1.27.x"
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
go install golang.org/x/vuln/cmd/govulncheck@v1.7.0
govulncheck ./...
12 changes: 6 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.23.x"
go-version: "1.27.x"
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: go
queries: security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
16 changes: 8 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ jobs:
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.23.x"
go-version: "1.27.x"
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v9
with:
version: v1.61.0
version: v2.13.2

gofumpt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.23.x"
go-version: "1.27.x"
- name: Check formatting
run: |
go install mvdan.cc/gofumpt@latest
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
contents: write # create the GitHub Release
id-token: write # keyless signing / provenance
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v5
- uses: actions/setup-go@v7
with:
go-version: "1.23.x"
go-version: "1.27.x"
- name: Install Syft (SBOM generation)
uses: anchore/sbom-action/download-syft@v0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
uses: goreleaser/goreleaser-action@v7
with:
version: "~> v2"
args: release --clean
Expand Down
81 changes: 47 additions & 34 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,72 @@
# golangci-lint configuration. Run: make lint (or: golangci-lint run)
# golangci-lint configuration (v2 schema). Run: make lint (or: golangci-lint run)
version: "2"
run:
timeout: 5m
tests: true

linters:
enable:
- asasalint
- bodyclose
- copyloopvar
- dupl
- errcheck
- errorlint
- gocritic
- gocyclo
- gofumpt
- goimports
- gosec
- govet
- ineffassign
- misspell
- nakedret
- nilerr
- nolintlint
- predeclared
- revive
- staticcheck
- unconvert
- unparam
- unused
- whitespace

linters-settings:
gocyclo:
min-complexity: 20
goimports:
local-prefixes: github.com/cjunius/goChess
govet:
enable-all: true
disable:
- fieldalignment
revive:
settings:
dupl:
threshold: 150
gocyclo:
min-complexity: 20
govet:
disable:
- fieldalignment
enable-all: true
revive:
rules:
- name: exported
arguments:
- checkPrivateReceivers
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- name: exported
arguments: ["checkPrivateReceivers"]
dupl:
threshold: 150

- linters:
- dupl
- gocyclo
- gosec
- unparam
path: _test\.go
paths:
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
# Test files: allow table-driven duplication and skip some strictness.
- path: _test\.go
linters:
- dupl
- gocyclo
- gosec
- unparam
formatters:
enable:
- gofumpt
- goimports
settings:
goimports:
local-prefixes:
- github.com/cjunius/goChess
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN CGO_ENABLED=0 go build -trimpath \
-ldflags="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}" \
-o /out/gochess ./cmd/gochess

FROM gcr.io/distroless/static-debian12:nonroot
FROM gcr.io/distroless/static-debian13:nonroot
COPY --from=build /out/gochess /usr/local/bin/gochess
# UCI speaks over stdin/stdout; keep the container attached.
ENTRYPOINT ["/usr/local/bin/gochess"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ tidy:
check: tidy lint vuln test

## dev-tools: install development tooling (versions tracked here and in CI)
GOLANGCI_VERSION ?= v1.61.0
GOLANGCI_VERSION ?= v2.13.2
.PHONY: dev-tools
dev-tools:
$(GO) install mvdan.cc/gofumpt@latest
$(GO) install golang.org/x/tools/cmd/goimports@latest
$(GO) install golang.org/x/vuln/cmd/govulncheck@v1.1.4
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_VERSION)
$(GO) install golang.org/x/vuln/cmd/govulncheck@v1.7.0
$(GO) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_VERSION)

## docker: build the container image
.PHONY: docker
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/cjunius/goChess

go 1.22.3
go 1.27.0

require github.com/dylhunn/dragontoothmg v0.0.0-20220917014754-e79413b50d93