| 1 |
name: ci-pipeline |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: [ master ] |
| 5 |
pull_request: |
| 6 |
branches: [ master ] |
| 7 |
jobs: |
| 8 |
ci: |
| 9 |
strategy: |
| 10 |
matrix: |
| 11 |
go-version: [ '1.21', '1.22', '1.23' ] |
| 12 |
runs-on: ubuntu-latest |
| 13 |
steps: |
| 14 |
- uses: actions/checkout@v4 |
| 15 |
- name: Set up Go |
| 16 |
uses: actions/setup-go@v5 |
| 17 |
with: |
| 18 |
go-version: ${{ matrix.go-version }} |
| 19 |
- name: Build |
| 20 |
run: | |
| 21 |
go mod tidy && git diff --exit-code |
| 22 |
go build ./cmd/... ./pkg/... |
| 23 |
- name: Format |
| 24 |
run: | |
| 25 |
diff=$(gofmt -s -d .) |
| 26 |
if [[ -n "${diff}" ]]; then echo "${diff}"; exit 1; fi |
| 27 |
- name: Test |
| 28 |
run: | |
| 29 |
go test -race ./cmd/... ./pkg/... |
| 30 |
- name: Run integration tests |
| 31 |
run: | |
| 32 |
cd test/integration |
| 33 |
go mod tidy && git diff --exit-code |
| 34 |
go test ./... |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
- name: Run verify scripts |
| 39 |
run: | |
| 40 |
./hack/verify-go-directive.sh 1.21 |
| 41 |
required: |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
needs: ci |
| 46 |
runs-on: ubuntu-latest |
| 47 |
steps: |
| 48 |
- run: echo "Required jobs success!" |