diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..4fc4a8e --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,52 @@ +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