diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000000..38e2d8dc5ada --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + +permissions: + contents: read + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-go@v6 + with: + go-version: '1.22' + - name: gofmt + run: | + files="$(gofmt -l .)" + if [ -n "$files" ]; then + echo "The following files are not gofmt-formatted:" + echo "$files" + exit 1 + fi + - name: go vet + run: go vet ./... + + ci: + name: ci + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-go@v6 + with: + go-version: '1.22' + - name: build + run: go build ./... + - name: test + run: go test ./...