name: CI on: push: branches: [ main ] pull_request: types: [opened, reopened, synchronize] jobs: build-test: name: Build, test, and format strategy: matrix: go-version: ['1.20.x'] platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Setup Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: go-version: ${{ matrix.go-version }} - name: Format if: matrix.platform == 'ubuntu-latest' run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi - name: Build run: go build -v ./... - name: Test run: go test -v ./...