Skip to content

generator: improve display for table with schema + formatting #32

generator: improve display for table with schema + formatting

generator: improve display for table with schema + formatting #32

Workflow file for this run

name: CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.24.x]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Install dependencies
run: go mod tidy
- name: Run tests with coverage
run: |
go test -v -coverprofile=coverage.out ./tests/...
go tool cover -func=coverage.out
- name: Build
run: go build ./cmd/gorm-migrate
test-postgresql:
name: Test PostgreSQL
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.24.x]
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: gorm_migrate_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Install dependencies
run: go mod tidy
- name: Wait for PostgreSQL
run: |
until pg_isready -h localhost -p 5432 -U postgres; do
echo "Waiting for PostgreSQL to be ready..."
sleep 2
done
- name: Run PostgreSQL tests
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: gorm_migrate_test
run: |
go test -v -run "TestPostgreSQL" ./tests/migration/diff/
- name: Build
run: go build ./cmd/gorm-migrate
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
cache: true
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest
- name: Run golangci-lint
run: $(go env GOPATH)/bin/golangci-lint run --enable=govet,staticcheck --disable=errcheck,ineffassign,unused --timeout=5m ./...