diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 9eb7f59..3ed0167 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -8,12 +8,15 @@ on: jobs: go-mod: + strategy: + matrix: + go-version: ["1.19", "1.20", "1.21-rc.2"] runs-on: ubuntu-latest steps: - name: Install Go uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: - go-version: 'oldstable' + go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - name: Check module vendoring @@ -21,23 +24,42 @@ jobs: go mod tidy go mod vendor git diff --exit-code - build: + strategy: + matrix: + go-version: ["1.19", "1.20", "1.21-rc.2"] runs-on: ubuntu-latest needs: go-mod steps: - name: Install Go uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: - go-version: 'oldstable' + go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - name: Go code prechecks run: | go build ./... - lint: + unit-test: + strategy: + matrix: + go-version: ["1.19", "1.20", "1.21-rc.2"] runs-on: ubuntu-latest needs: build + steps: + - name: Install Go + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + - name: Checkout code + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - name: Go code prechecks + run: | + go test ./... + lint: + runs-on: ubuntu-latest + needs: unit-test steps: - name: Checkout code uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 @@ -51,17 +73,3 @@ jobs: # for output args: --config=.golangci.yml --verbose --out-${NO_FUTURE}format colored-line-number skip-cache: true - - unit-test: - runs-on: ubuntu-latest - needs: lint - steps: - - name: Install Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 - with: - go-version: 'oldstable' - - name: Checkout code - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - - name: Go code prechecks - run: | - go test ./...