ci: drop 1.17 tests and add 1.20-rc.3 (#455)

pull/462/head
Michael Fridman 2023-01-28 09:21:36 -05:00 committed by GitHub
parent ad90652042
commit c2f9bcbc80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 65 deletions

View File

@ -13,18 +13,20 @@ jobs:
strategy:
matrix:
go-version: [1.17, 1.18, 1.19]
go-version: [1.18, 1.19, '1.20.0-rc.3']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
check-latest: true
cache: true
- name: Check Go code formatting
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then

View File

@ -12,42 +12,19 @@ jobs:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
dialect: ["postgres", "mysql"]
dialect: ["postgres", "mysql", "vertica", "clickhouse"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: "1.18"
- name: Checkout code
uses: actions/checkout@v3
go-version: "1.19"
check-latest: true
cache: true
- name: Run e2e ${{ matrix.dialect }} tests
run: |
make test-e2e-${{ matrix.dialect }}
test-clickhouse:
name: Run clickhouse tests
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: "1.18"
- name: Run clickhouse test
run: make test-clickhouse
test-vertica:
name: Run vertica tests
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: "1.18"
- name: Run vertica test
run: make test-vertica

View File

@ -9,14 +9,16 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
check-latest: true
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:

View File

@ -10,7 +10,8 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.x

View File

@ -1,3 +1,5 @@
GO_TEST_FLAGS ?= -race -count=1 -v -timeout=10m
.PHONY: dist
dist:
@mkdir -p ./bin
@ -8,35 +10,6 @@ dist:
GOOS=windows GOARCH=amd64 go build -o ./bin/goose-windows64.exe ./cmd/goose
GOOS=windows GOARCH=386 go build -o ./bin/goose-windows386.exe ./cmd/goose
test-packages:
go test -v $$(go list ./... | grep -v -e /tests -e /bin -e /cmd -e /examples)
test-e2e: test-e2e-postgres test-e2e-mysql
test-e2e-postgres:
go test -v ./tests/e2e -dialect=postgres
test-e2e-mysql:
go test -v ./tests/e2e -dialect=mysql
test-clickhouse:
go test -timeout=10m -count=1 -race -v ./tests/clickhouse -test.short
test-vertica:
go test -count=1 -v ./tests/vertica
docker-cleanup:
docker stop -t=0 $$(docker ps --filter="label=goose_test" -aq)
start-postgres:
docker run --rm -d \
-e POSTGRES_USER=${GOOSE_POSTGRES_DB_USER} \
-e POSTGRES_PASSWORD=${GOOSE_POSTGRES_PASSWORD} \
-e POSTGRES_DB=${GOOSE_POSTGRES_DBNAME} \
-p ${GOOSE_POSTGRES_PORT}:5432 \
-l goose_test \
postgres:14-alpine
.PHONY: clean
clean:
@find . -type f -name '*.FAIL' -delete
@ -48,3 +21,32 @@ lint: tools
.PHONY: tools
tools:
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
test-packages:
go test $(GO_TEST_FLAGS) $$(go list ./... | grep -v -e /tests -e /bin -e /cmd -e /examples)
test-e2e: test-e2e-postgres test-e2e-mysql test-e2e-clickhouse test-e2e-vertica
test-e2e-postgres:
go test $(GO_TEST_FLAGS) ./tests/e2e -dialect=postgres
test-e2e-mysql:
go test $(GO_TEST_FLAGS) ./tests/e2e -dialect=mysql
test-e2e-clickhouse:
go test $(GO_TEST_FLAGS) ./tests/clickhouse -test.short
test-e2e-vertica:
go test $(GO_TEST_FLAGS) ./tests/vertica
docker-cleanup:
docker stop -t=0 $$(docker ps --filter="label=goose_test" -aq)
docker-start-postgres:
docker run --rm -d \
-e POSTGRES_USER=${GOOSE_POSTGRES_DB_USER} \
-e POSTGRES_PASSWORD=${GOOSE_POSTGRES_PASSWORD} \
-e POSTGRES_DB=${GOOSE_POSTGRES_DBNAME} \
-p ${GOOSE_POSTGRES_PORT}:5432 \
-l goose_test \
postgres:14-alpine