-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
391fafa
commit f543257
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "*" | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-13 | ||
- macos-14 | ||
- ubuntu-22.04 | ||
- windows-2022 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.work | ||
cache-dependency-path: "**/go.sum" | ||
|
||
- name: run checks | ||
run: go run build check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Notable rationale of go-build | ||
|
||
## Use goyek | ||
|
||
We do not use Makefile, probably the most common tool for builds in Go, because | ||
it is tedious to do complex tasks and hard to make cross-platform. | ||
|
||
We have used [Mage](https://magefile.org/) in other projects and it works well - | ||
for projects that currently use Makefile, it can be easier to convince members | ||
to migrate to it vs goyek. It has some quirks though. | ||
|
||
For further details, see goyek's [explanation](https://github.com/goyek/goyek?tab=readme-ov-file#alternatives) | ||
which is fair and follows our thoughts. | ||
|
||
## Use gofumpt | ||
|
||
We prefer to have less bikeshedding in code reviews, and this includes formatting. | ||
While this isn't as prevalent in the Go ecosystem yet, it is common practice in others | ||
such as NodeJS. Where possible, we will prefer auto-formatting that enforces as much | ||
structure as possible. It's automatic, so why not? | ||
|
||
## Use gci | ||
|
||
We believe there is significant stylistic benefit in having consistent import | ||
ordering and grouping, something the Go standard goimports [cannot do](https://github.com/golang/go/issues/20818). | ||
Both gci and gosimports are great tools for this, and we choose gci because it | ||
is also integrated with golangci-lint, making it simpler to verify in CI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters