Skip to content

Add wrapper types for Text/Binary Marshaler and Stringer #602

Add wrapper types for Text/Binary Marshaler and Stringer

Add wrapper types for Text/Binary Marshaler and Stringer #602

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ 'oldstable', 'stable' ]
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: pass
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
steps:
- name: PostgreSQL Setup
run: >
echo "*:*:*:*:pass" > $HOME/.pgpass
&& chmod 600 $HOME/.pgpass
&& psql --host localhost --username user -c 'CREATE DATABASE dialect_droppable;'
&& psql --host localhost --username user -c 'CREATE DATABASE driver_droppable;'
- name: MySQL Setup
run: >
echo -e "[client]\nuser = root\npassword = pass\nhost = localhost\nprotocol = tcp" > $HOME/.my.cnf
&& chmod 600 $HOME/.my.cnf
&& mysql --execute 'CREATE DATABASE dialect_droppable;'
&& mysql --execute 'CREATE DATABASE driver_droppable;'
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
- name: Install Dependencies
run: go mod download
- name: Run tests
env:
PSQL_DIALECT_TEST_DSN: postgresql://user:pass@localhost:5432/dialect_droppable?sslmode=disable
PSQL_DRIVER_TEST_DSN: postgresql://user:pass@localhost:5432/driver_droppable?sslmode=disable
MYSQL_DIALECT_TEST_DSN: root:pass@(localhost:3306)/dialect_droppable?tls=skip-verify&multiStatements=true
MYSQL_DRIVER_TEST_DSN: root:pass@(localhost:3306)/driver_droppable?tls=skip-verify&multiStatements=true
run: go test -race -covermode atomic -coverprofile=covprofile.out -coverpkg=github.com/stephenafamo/bob/... ./...
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: covprofile.out
flag-name: go-${{ matrix.go }}
parallel: true
finish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true
test-windows-sqlite:
# Run generation test on windows to catch filepath issues
# Testing Postgres and MySQL are not possible since the windows runner
# does not support containers
runs-on: windows-latest
strategy:
matrix:
go: ['stable' ]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
- name: Install Dependencies
run: go mod download
- name: Run tests
run: go test -race ./gen/bobgen-sqlite/driver