diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..3da399f --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,37 @@ +name: Pull Request + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + arch: [ linux/amd64, linux/arm64 ] + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '>=1.21.0' + - name: Go Format + run: make fmt && git diff --exit-code + - name: Go Vet + run: make vet + - name: Go Tidy + run: go mod tidy && git diff --exit-code + - name: Go Mod + run: go mod download + - name: Go Mod Verify + run: go mod verify + - name: Go Build + run: make build + - name: Go Build + run: make test + + + + + diff --git a/Makefile b/Makefile index d2a9528..6cbd8bc 100644 --- a/Makefile +++ b/Makefile @@ -26,11 +26,15 @@ integration: RUN_INTEGRATION_TESTS=true go test -v ./... .PHONY: integration +vet: + go vet ./... +.PHONY: vet + fmt: gofmt -s -w . .PHONY: fmt -check: fmt clean build build-docker lint test integration +check: fmt vet clean build build-docker lint test integration .PHONY: check lint: