add oracle deps for testing

This commit is contained in:
Jim Lambert 2020-02-19 20:51:01 -05:00
parent d959159ccf
commit ade888bb40

View File

@ -2,184 +2,193 @@
box: golang box: golang
services: services:
- name: mariadb - name: mariadb
id: mariadb:latest id: mariadb:latest
env: env:
MYSQL_DATABASE: gorm MYSQL_DATABASE: gorm
MYSQL_USER: gorm MYSQL_USER: gorm
MYSQL_PASSWORD: gorm MYSQL_PASSWORD: gorm
MYSQL_RANDOM_ROOT_PASSWORD: "yes" MYSQL_RANDOM_ROOT_PASSWORD: "yes"
- name: mysql - name: mysql
id: mysql:latest id: mysql:latest
env: env:
MYSQL_DATABASE: gorm MYSQL_DATABASE: gorm
MYSQL_USER: gorm MYSQL_USER: gorm
MYSQL_PASSWORD: gorm MYSQL_PASSWORD: gorm
MYSQL_RANDOM_ROOT_PASSWORD: "yes" MYSQL_RANDOM_ROOT_PASSWORD: "yes"
- name: mysql57 - name: mysql57
id: mysql:5.7 id: mysql:5.7
env: env:
MYSQL_DATABASE: gorm MYSQL_DATABASE: gorm
MYSQL_USER: gorm MYSQL_USER: gorm
MYSQL_PASSWORD: gorm MYSQL_PASSWORD: gorm
MYSQL_RANDOM_ROOT_PASSWORD: "yes" MYSQL_RANDOM_ROOT_PASSWORD: "yes"
- name: mysql56 - name: mysql56
id: mysql:5.6 id: mysql:5.6
env: env:
MYSQL_DATABASE: gorm MYSQL_DATABASE: gorm
MYSQL_USER: gorm MYSQL_USER: gorm
MYSQL_PASSWORD: gorm MYSQL_PASSWORD: gorm
MYSQL_RANDOM_ROOT_PASSWORD: "yes" MYSQL_RANDOM_ROOT_PASSWORD: "yes"
- name: postgres - name: postgres
id: postgres:latest id: postgres:latest
env: env:
POSTGRES_USER: gorm POSTGRES_USER: gorm
POSTGRES_PASSWORD: gorm POSTGRES_PASSWORD: gorm
POSTGRES_DB: gorm POSTGRES_DB: gorm
- name: postgres96 - name: postgres96
id: postgres:9.6 id: postgres:9.6
env: env:
POSTGRES_USER: gorm POSTGRES_USER: gorm
POSTGRES_PASSWORD: gorm POSTGRES_PASSWORD: gorm
POSTGRES_DB: gorm POSTGRES_DB: gorm
- name: postgres95 - name: postgres95
id: postgres:9.5 id: postgres:9.5
env: env:
POSTGRES_USER: gorm POSTGRES_USER: gorm
POSTGRES_PASSWORD: gorm POSTGRES_PASSWORD: gorm
POSTGRES_DB: gorm POSTGRES_DB: gorm
- name: postgres94 - name: postgres94
id: postgres:9.4 id: postgres:9.4
env: env:
POSTGRES_USER: gorm POSTGRES_USER: gorm
POSTGRES_PASSWORD: gorm POSTGRES_PASSWORD: gorm
POSTGRES_DB: gorm POSTGRES_DB: gorm
- name: postgres93 - name: postgres93
id: postgres:9.3 id: postgres:9.3
env: env:
POSTGRES_USER: gorm POSTGRES_USER: gorm
POSTGRES_PASSWORD: gorm POSTGRES_PASSWORD: gorm
POSTGRES_DB: gorm POSTGRES_DB: gorm
- name: mssql - name: mssql
id: mcmoe/mssqldocker:latest id: mcmoe/mssqldocker:latest
env: env:
ACCEPT_EULA: Y ACCEPT_EULA: Y
SA_PASSWORD: LoremIpsum86 SA_PASSWORD: LoremIpsum86
MSSQL_DB: gorm MSSQL_DB: gorm
MSSQL_USER: gorm MSSQL_USER: gorm
MSSQL_PASSWORD: LoremIpsum86 MSSQL_PASSWORD: LoremIpsum86
- name: oracle
id: jimlambrt/gorm-ora:latest
# The steps that will be executed in the build pipeline # The steps that will be executed in the build pipeline
build: build:
# The steps that will be executed on build # The steps that will be executed on build
steps: steps:
# Sets the go workspace and places you package # Sets the go workspace and places you package
# at the right place in the workspace tree # at the right place in the workspace tree
- setup-go-workspace - setup-go-workspace
- script: - script:
name: install-oci-pkgs name: install-oci-pkgs
code: | code: |
sudo apt-get update sudo apt-get update
sudo apt-get -y install pkg-config gcc wget alien libaio1 libaio-dev sudo apt-get -y install pkg-config gcc wget alien libaio1 libaio-dev unzip netcat
- script: - script:
name: install-instantclients name: install-instantclients
code: | code: |
cd $WERCKER_SOURCE_DIR/dialects/oci8/contrib cd $WERCKER_SOURCE_DIR/dialects/oci8/contrib
alien -i oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm unzip instaclients.zip
alien -i oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm alien -i oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm
alien -i oracle-instantclient19.6-devel-19.6.0.0.0-1.x86_64.rpm alien -i oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm
alien -i oracle-instantclient19.6-devel-19.6.0.0.0-1.x86_64.rpm
- script: - script:
name: create-oci8-pkg-config name: create-oci8-pkg-config
code: | code: |
echo "creating oci8.pc" echo "creating oci8.pc"
mkdir -p /usr/local/pkg_config mkdir -p /usr/local/pkg_config
cd /usr/local/pkg_config cd /usr/local/pkg_config
export ORACLE_LIB=/usr/lib/oracle/19.6/client64 export ORACLE_LIB=/usr/lib/oracle/19.6/client64
export ORACLE_INC=/usr/include/oracle/19.6/client64 export ORACLE_INC=/usr/include/oracle/19.6/client64
export PKG_CONFIG_PATH=/usr/local/pkg_config export PKG_CONFIG_PATH=/usr/local/pkg_config
cat > oci8.pc <<PKGCONFIG cat > oci8.pc <<PKGCONFIG
Name: oci8 Name: oci8
Description: Oracle Call Interface Description: Oracle Call Interface
Version: 19.6 Version: 19.6
Cflags: -I${ORACLE_INC} Cflags: -I${ORACLE_INC}
Libs: -L${ORACLE_LIB}/lib -Wl,-rpath,${ORACLE_LIB}/lib -lclntsh Libs: -L${ORACLE_LIB}/lib -Wl,-rpath,${ORACLE_LIB}/lib -lclntsh
PKGCONFIG PKGCONFIG
# Gets the dependencies # Gets the dependencies
- script: - script:
name: go get name: go get
code: | code: |
cd $WERCKER_SOURCE_DIR cd $WERCKER_SOURCE_DIR
go version go version
go get -t -v ./... go get -t -v ./...
# Build the project # Build the project
- script: - script:
name: go build name: go build
code: | code: |
go build ./... go build ./...
# Test the project # Test the project
- script: - script:
name: test sqlite name: test sqlite
code: | code: |
go test -race -v ./... go test -race -v ./...
- script: - script:
name: test mariadb name: test mariadb
code: | code: |
GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mariadb:3306)/gorm?charset=utf8&parseTime=True" go test -race ./... GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mariadb:3306)/gorm?charset=utf8&parseTime=True" go test -race ./...
- script: - script:
name: test mysql name: test mysql
code: | code: |
GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql:3306)/gorm?charset=utf8&parseTime=True" go test -race ./... GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql:3306)/gorm?charset=utf8&parseTime=True" go test -race ./...
- script: - script:
name: test mysql5.7 name: test mysql5.7
code: | code: |
GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql57:3306)/gorm?charset=utf8&parseTime=True" go test -race ./... GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql57:3306)/gorm?charset=utf8&parseTime=True" go test -race ./...
- script: - script:
name: test mysql5.6 name: test mysql5.6
code: | code: |
GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql56:3306)/gorm?charset=utf8&parseTime=True" go test -race ./... GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql56:3306)/gorm?charset=utf8&parseTime=True" go test -race ./...
- script: - script:
name: test postgres name: test postgres
code: | code: |
GORM_DIALECT=postgres GORM_DSN="host=postgres user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./... GORM_DIALECT=postgres GORM_DSN="host=postgres user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
- script: - script:
name: test postgres96 name: test postgres96
code: | code: |
GORM_DIALECT=postgres GORM_DSN="host=postgres96 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./... GORM_DIALECT=postgres GORM_DSN="host=postgres96 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
- script: - script:
name: test postgres95 name: test postgres95
code: | code: |
GORM_DIALECT=postgres GORM_DSN="host=postgres95 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./... GORM_DIALECT=postgres GORM_DSN="host=postgres95 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
- script: - script:
name: test postgres94 name: test postgres94
code: | code: |
GORM_DIALECT=postgres GORM_DSN="host=postgres94 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./... GORM_DIALECT=postgres GORM_DSN="host=postgres94 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
- script: - script:
name: test postgres93 name: test postgres93
code: | code: |
GORM_DIALECT=postgres GORM_DSN="host=postgres93 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./... GORM_DIALECT=postgres GORM_DSN="host=postgres93 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
- script: - script:
name: test mssql name: test mssql
code: | code: |
GORM_DIALECT=mssql GORM_DSN="sqlserver://gorm:LoremIpsum86@mssql:1433?database=gorm" go test -race ./... GORM_DIALECT=mssql GORM_DSN="sqlserver://gorm:LoremIpsum86@mssql:1433?database=gorm" go test -race ./...
- script: - script:
name: codecov name: test oracle
code: | code: |
go test -race -coverprofile=coverage.txt -covermode=atomic ./... go run $WERCKER_SOURCE_DIR/dialects/oci8/contrib/connection.go
bash <(curl -s https://codecov.io/bash) GORM_DIALECT=oci8 GORM_DSN="gorm/gorm@oracle:1521/XEPDB1" go test -race ./...
- script:
name: codecov
code: |
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
bash <(curl -s https://codecov.io/bash)