53 lines
1.1 KiB
YAML
53 lines
1.1 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: archlinux:latest
|
|
steps:
|
|
- name: Install container prereqs
|
|
run: pacman -Sy --needed --noconfirm base-devel git shellcheck
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: go vet
|
|
run: go vet ./...
|
|
|
|
- name: gofmt check
|
|
run: |
|
|
diff=$(gofmt -l .)
|
|
if [ -n "$diff" ]; then
|
|
echo "files need gofmt:"
|
|
echo "$diff"
|
|
exit 1
|
|
fi
|
|
|
|
- name: go build
|
|
run: go build ./...
|
|
|
|
- name: go test -race
|
|
run: go test -race ./...
|
|
|
|
- name: shellcheck bootstrap.sh
|
|
run: shellcheck bootstrap.sh
|
|
|
|
- name: Install goreleaser
|
|
run: go install github.com/goreleaser/goreleaser/v2@latest
|
|
|
|
- name: goreleaser check
|
|
run: $(go env GOPATH)/bin/goreleaser check
|