Skip to content

Commit

Permalink
Refactor CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Nymphium committed Jul 6, 2023
1 parent e120ce6 commit 7f8bd24
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -55,7 +59,8 @@ jobs:
# - macOS-latest
# - windows-latest
go:
- "1.19.1"
- "1.19.10"
- "1.20.5"
services:
postgres:
image: postgres:12
Expand All @@ -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
Expand Down

0 comments on commit 7f8bd24

Please sign in to comment.