Skip to content

Commit

Permalink
ci: drop 1.17 tests and add 1.20-rc.3 (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman authored Jan 28, 2023
1 parent ad90652 commit c2f9bcb
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 57 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 7 additions & 30 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 23 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
GO_TEST_FLAGS ?= -race -count=1 -v -timeout=10m

.PHONY: dist
dist:
@mkdir -p ./bin
Expand All @@ -8,43 +10,43 @@ 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

.PHONY: clean
clean:
@find . -type f -name '*.FAIL' -delete

.PHONY: lint
lint: tools
@golangci-lint run ./... --fix

.PHONY: tools
tools:
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1

test-packages:
go test -v $$(go list ./... | grep -v -e /tests -e /bin -e /cmd -e /examples)
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: test-e2e-postgres test-e2e-mysql test-e2e-clickhouse test-e2e-vertica

test-e2e-postgres:
go test -v ./tests/e2e -dialect=postgres
go test $(GO_TEST_FLAGS) ./tests/e2e -dialect=postgres

test-e2e-mysql:
go test -v ./tests/e2e -dialect=mysql
go test $(GO_TEST_FLAGS) ./tests/e2e -dialect=mysql

test-clickhouse:
go test -timeout=10m -count=1 -race -v ./tests/clickhouse -test.short
test-e2e-clickhouse:
go test $(GO_TEST_FLAGS) ./tests/clickhouse -test.short

test-vertica:
go test -count=1 -v ./tests/vertica
test-e2e-vertica:
go test $(GO_TEST_FLAGS) ./tests/vertica

docker-cleanup:
docker stop -t=0 $$(docker ps --filter="label=goose_test" -aq)

start-postgres:
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

.PHONY: clean
clean:
@find . -type f -name '*.FAIL' -delete

.PHONY: lint
lint: tools
@golangci-lint run ./... --fix

.PHONY: tools
tools:
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1

0 comments on commit c2f9bcb

Please sign in to comment.