mirror of https://github.com/pressly/goose.git
ci: drop 1.17 tests and add 1.20-rc.3 (#455)
parent
ad90652042
commit
c2f9bcbc80
|
@ -13,18 +13,20 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [1.17, 1.18, 1.19]
|
go-version: [1.18, 1.19, '1.20.0-rc.3']
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
- name: Checkout code
|
check-latest: true
|
||||||
uses: actions/checkout@v3
|
cache: true
|
||||||
- name: Check Go code formatting
|
- name: Check Go code formatting
|
||||||
run: |
|
run: |
|
||||||
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
|
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
|
||||||
|
|
|
@ -12,42 +12,19 @@ jobs:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
max-parallel: 2
|
||||||
matrix:
|
matrix:
|
||||||
dialect: ["postgres", "mysql"]
|
dialect: ["postgres", "mysql", "vertica", "clickhouse"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: "1.18"
|
go-version: "1.19"
|
||||||
- name: Checkout code
|
check-latest: true
|
||||||
uses: actions/checkout@v3
|
cache: true
|
||||||
- name: Run e2e ${{ matrix.dialect }} tests
|
- name: Run e2e ${{ matrix.dialect }} tests
|
||||||
run: |
|
run: |
|
||||||
make test-e2e-${{ matrix.dialect }}
|
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
|
|
||||||
|
|
|
@ -9,14 +9,16 @@ jobs:
|
||||||
goreleaser:
|
goreleaser:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.19
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v4
|
uses: goreleaser/goreleaser-action@v4
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -10,7 +10,8 @@ jobs:
|
||||||
name: lint
|
name: lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.x
|
go-version: 1.19.x
|
||||||
|
|
60
Makefile
60
Makefile
|
@ -1,3 +1,5 @@
|
||||||
|
GO_TEST_FLAGS ?= -race -count=1 -v -timeout=10m
|
||||||
|
|
||||||
.PHONY: dist
|
.PHONY: dist
|
||||||
dist:
|
dist:
|
||||||
@mkdir -p ./bin
|
@mkdir -p ./bin
|
||||||
|
@ -8,35 +10,6 @@ dist:
|
||||||
GOOS=windows GOARCH=amd64 go build -o ./bin/goose-windows64.exe ./cmd/goose
|
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
|
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
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@find . -type f -name '*.FAIL' -delete
|
@find . -type f -name '*.FAIL' -delete
|
||||||
|
@ -48,3 +21,32 @@ lint: tools
|
||||||
.PHONY: tools
|
.PHONY: tools
|
||||||
tools:
|
tools:
|
||||||
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
|
@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
|
||||||
|
|
Loading…
Reference in New Issue