mirror of
https://github.com/marcusDenslow/terminalShop.git
synced 2026-10-25 10:02:21 +01:00
* ci(checks): add pull request workflow and golangci-lint config * refactor(lint): resolve golangci-lint findings * style(tui): drop traling blank line for gofmt * fix(cards): handle crypto/rand.Read error in storeRedirect
39 lines
750 B
YAML
39 lines
750 B
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Build
|
|
run: go build ./...
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Format check
|
|
run: |
|
|
unformatted=$(gofmt -l $(go list -f '{{.Dir}}' ./...))
|
|
if [ -n "$unformatted" ]; then
|
|
echo "These files need gofmt:"
|
|
echo "$unformatted"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Lint
|
|
uses: golangci/golangci-lint-action@v7
|
|
with:
|
|
version: v2.4.0
|
|
|
|
- name: Test (race detector)
|
|
run: go test -race ./...
|