diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9fb09af..a7db004 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,9 @@ jobs: # - macOS-latest # - windows-latest go: - - "1.19.1" + - "1.19.10" + - "1.20.5" + - "1.21.0-rc.2" services: postgres: image: postgres:12 @@ -31,19 +33,21 @@ jobs: run: | psql -U postgres -h localhost -d postgres -c 'CREATE USER dgw_test;' psql -U postgres -h localhost -d postgres -c 'CREATE DATABASE dgw_test OWNER dgw_test;' + - name: Checkout code + uses: actions/checkout/@v3 - name: Install Go - uses: actions/setup-go/@v2 + uses: actions/setup-go/@v4 with: go-version: ${{ matrix.go }} - - - name: Checkout code - uses: actions/checkout/@v3 - + - name: Download Go modules + shell: bash + if: ${{ steps.setup-go.outputs.cache-hit != 'true' }} + run: go mod download - name: Lint uses: golangci/golangci-lint-action@v3 - - name: Run test run: go test -v + check-test-gen: runs-on: ${{ matrix.os }} strategy: @@ -55,7 +59,8 @@ jobs: # - macOS-latest # - windows-latest go: - - "1.19.1" + - "1.19.10" + - "1.20.5" services: postgres: image: postgres:12 @@ -70,17 +75,20 @@ jobs: run: | psql -U postgres -h localhost -d postgres -c 'CREATE USER dgw_test;' psql -U postgres -h localhost -d postgres -c 'CREATE DATABASE dgw_test OWNER dgw_test;' + - name: Checkout code + uses: actions/checkout/@v3 - name: Install Go - uses: actions/setup-go/@v2 + uses: actions/setup-go/@v4 with: go-version: ${{ matrix.go }} - - - name: Checkout code - uses: actions/checkout/@v3 - - - name: Lint - uses: golangci/golangci-lint-action@v3 - + - name: Download Go modules + shell: bash + if: ${{ steps.setup-go.outputs.cache-hit != 'true' }} + run: go mod download + - name: Install deps + run: | + go install golang.org/x/tools/cmd/goimports@latest + go install - name: Generate run: go generate -v ./example - name: Check diff