Skip to content

Commit 7f8bd24

Browse files
committed
Refactor CI
1 parent e120ce6 commit 7f8bd24

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

.github/workflows/test.yml

+24-16
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616
# - macOS-latest
1717
# - windows-latest
1818
go:
19-
- "1.19.1"
19+
- "1.19.10"
20+
- "1.20.5"
21+
- "1.21.0-rc.2"
2022
services:
2123
postgres:
2224
image: postgres:12
@@ -31,19 +33,21 @@ jobs:
3133
run: |
3234
psql -U postgres -h localhost -d postgres -c 'CREATE USER dgw_test;'
3335
psql -U postgres -h localhost -d postgres -c 'CREATE DATABASE dgw_test OWNER dgw_test;'
36+
- name: Checkout code
37+
uses: actions/checkout/@v3
3438
- name: Install Go
35-
uses: actions/setup-go/@v2
39+
uses: actions/setup-go/@v4
3640
with:
3741
go-version: ${{ matrix.go }}
38-
39-
- name: Checkout code
40-
uses: actions/checkout/@v3
41-
42+
- name: Download Go modules
43+
shell: bash
44+
if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
45+
run: go mod download
4246
- name: Lint
4347
uses: golangci/golangci-lint-action@v3
44-
4548
- name: Run test
4649
run: go test -v
50+
4751
check-test-gen:
4852
runs-on: ${{ matrix.os }}
4953
strategy:
@@ -55,7 +59,8 @@ jobs:
5559
# - macOS-latest
5660
# - windows-latest
5761
go:
58-
- "1.19.1"
62+
- "1.19.10"
63+
- "1.20.5"
5964
services:
6065
postgres:
6166
image: postgres:12
@@ -70,17 +75,20 @@ jobs:
7075
run: |
7176
psql -U postgres -h localhost -d postgres -c 'CREATE USER dgw_test;'
7277
psql -U postgres -h localhost -d postgres -c 'CREATE DATABASE dgw_test OWNER dgw_test;'
78+
- name: Checkout code
79+
uses: actions/checkout/@v3
7380
- name: Install Go
74-
uses: actions/setup-go/@v2
81+
uses: actions/setup-go/@v4
7582
with:
7683
go-version: ${{ matrix.go }}
77-
78-
- name: Checkout code
79-
uses: actions/checkout/@v3
80-
81-
- name: Lint
82-
uses: golangci/golangci-lint-action@v3
83-
84+
- name: Download Go modules
85+
shell: bash
86+
if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
87+
run: go mod download
88+
- name: Install deps
89+
run: |
90+
go install golang.org/x/tools/cmd/goimports@latest
91+
go install
8492
- name: Generate
8593
run: go generate -v ./example
8694
- name: Check diff

0 commit comments

Comments
 (0)