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
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.github
bin
dist
docs
*.md
!README.md
!LICENSE
*.out
*.prof
.golangci.yml
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.go]
indent_style = tab
indent_size = 4

[*.{yml,yaml,json,md,toml}]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Normalize line endings
* text=auto eol=lf

*.go text diff=golang
*.md text
*.yml text
*.yaml text

# Binary
*.png binary
*.bin binary

# Keep vendored/generated files out of language stats and diffs
go.sum linguist-generated=true
/vendor/** linguist-vendored=true
12 changes: 12 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Default owner for everything in the repo.
* @cjunius

# Engine internals — require review from the engine owner.
/internal/engine/ @cjunius
/internal/uci/ @cjunius

# Build, CI, and release configuration.
/.github/ @cjunius
/Makefile @cjunius
/Dockerfile @cjunius
/.goreleaser.yaml @cjunius
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Bug report
description: A crash, an illegal move, a wrong result, or other incorrect behavior
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: |
For security issues, do **not** file here — see SECURITY.md.
- type: textarea
id: what-happened
attributes:
label: What happened?
description: What did you expect, and what happened instead?
validations:
required: true
- type: input
id: fen
attributes:
label: Position (FEN)
placeholder: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
- type: textarea
id: repro
attributes:
label: Steps to reproduce
description: The exact UCI commands or CLI invocation.
placeholder: |
position fen <fen>
go movetime 1000
render: shell
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: Output of `gochess version`
validations:
required: true
- type: dropdown
id: os
attributes:
label: OS
options:
- Linux
- macOS
- Windows
- Other
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant output / logs
render: shell
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Question or discussion
url: https://github.com/cjunius/goChess/discussions
about: Ask how to use the engine, GUI setup, or general chess-programming questions.
- name: Security vulnerability
url: https://github.com/cjunius/goChess/security/advisories/new
about: Report a vulnerability privately (see SECURITY.md).
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Feature request
description: Suggest a new feature or improvement
labels: ["enhancement", "triage"]
body:
- type: textarea
id: problem
attributes:
label: Problem
description: What are you trying to do that is hard or impossible today?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed solution
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
- type: checkboxes
id: contribute
attributes:
label: Contribution
options:
- label: I am willing to open a PR for this
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- Thanks for contributing! Keep PRs focused on one logical change. -->

## What & why

<!-- What does this change and why? Link the issue it closes. -->

Closes #

## Type of change

- [ ] Bug fix
- [ ] New feature
- [ ] Chess strength change (search/eval)
- [ ] Refactor / internal
- [ ] Docs / CI / build

## Checklist

- [ ] `make check` passes locally (tidy + lint + vuln + test)
- [ ] Tests added or updated
- [ ] Move-generation changes include a passing perft test
- [ ] `CHANGELOG.md` updated under `## [Unreleased]`
- [ ] Commit messages follow Conventional Commits

## Strength impact (search/eval changes only)

<!--
Provide match results vs. the previous version, e.g.:
cutechess-cli, 2000 games, 10+0.1s, book UHO_XXL:
Elo +14.2 +/- 8.1, LOS 99.9%
-->

N/A
31 changes: 31 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
groups:
go-dependencies:
patterns:
- "*"
commit-message:
prefix: "chore(deps)"

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
groups:
github-actions:
patterns:
- "*"
commit-message:
prefix: "chore(ci)"

- package-ecosystem: docker
directory: "/"
schedule:
interval: weekly
commit-message:
prefix: "chore(docker)"
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
push:
branches: [main]
pull_request:
merge_group:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: ["1.22.x", "1.23.x"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Verify modules are tidy
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.23.x'
run: |
go mod tidy
git diff --exit-code -- go.mod go.sum
- name: Build
run: go build -v ./...
- name: Vet
run: go vet ./...
- name: Test (race, short)
run: go test -race -short -covermode atomic -coverprofile coverage.txt ./...
- name: Test (full, incl. deep perft)
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
with:
files: coverage.txt
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

vuln:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
govulncheck ./...
34 changes: 34 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CodeQL

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "27 4 * * 1"

permissions:
contents: read

jobs:
analyze:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: go
queries: security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint

on:
push:
branches: [main]
pull_request:
merge_group:

permissions:
contents: read

jobs:
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0

gofumpt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: Check formatting
run: |
go install mvdan.cc/gofumpt@latest
fmt_out="$(gofumpt -l .)"
if [ -n "$fmt_out" ]; then
echo "These files are not gofumpt-formatted:"
echo "$fmt_out"
exit 1
fi
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
push:
tags: ["v*"]

permissions:
contents: read

jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write # create the GitHub Release
id-token: write # keyless signing / provenance
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: Install Syft (SBOM generation)
uses: anchore/sbom-action/download-syft@v0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading