@ -1,4 +1,4 @@
name : "Pull: Database Tests"
name : db-tests
on : [ pull_request]
@ -7,8 +7,7 @@ concurrency:
cancel-in-progress : true
jobs:
# PostgreSQL Tests
db_pgsql_test:
test-pgsql:
runs-on : ubuntu-latest
services:
pgsql:
@ -33,61 +32,45 @@ jobs:
ports:
- "9000:9000"
steps:
- name : checkout
uses : actions/checkout@v3
- name : setup go
uses : actions/setup-go@v4
- uses : actions/checkout@v3
- uses : actions/setup-go@v4
with:
go-version : '>=1.20.0'
go-version : ">=1.20.0"
- name : Add hosts to /etc/hosts
run : echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts
- name : install dependencies
run : make deps-backend
- name : build
run : make backend
- run : make deps-backend
- run : make backend
env:
GOPROXY : https://goproxy.io
GOSUMDB : sum.golang.org
TAGS : bindata
- name : run tests
run : timeout -s ABRT 50m make test-pgsql-migration test-pgsql
- run : make test-pgsql-migration test-pgsql
timeout-minutes : 50
env:
GOPROXY : https://goproxy.io
TAGS : bindata gogit
RACE_ENABLED : true
TEST_TAGS : gogit
TEST_LDAP : 1
USE_REPO_TEST_DIR : 1
# SQLite Tests
db_sqlite_test:
test-sqlite:
runs-on : ubuntu-latest
steps:
- name : checkout
uses : actions/checkout@v3
- name : setup go
uses : actions/setup-go@v4
- uses : actions/checkout@v3
- uses : actions/setup-go@v4
with:
go-version : '>=1.20.0'
- name : install dependencies
run : make deps-backend
- name : build
run : make backend
go-version : ">=1.20.0"
- run : make deps-backend
- run : make backend
env:
GOPROXY : https://goproxy.io
GOSUMDB : sum.golang.org
TAGS : bindata gogit sqlite sqlite_unlock_notify
- name : run tests
run : timeout -s ABRT 50m make test-sqlite-migration test-sqlite
- run : make test-sqlite-migration test-sqlite
timeout-minutes : 50
env:
GOPROXY : https://goproxy.io
TAGS : bindata gogit sqlite sqlite_unlock_notify
RACE_ENABLED : true
TEST_TAGS : gogit sqlite sqlite_unlock_notify
USE_REPO_TEST_DIR : 1
# Unit Tests
db_unit_tests:
test-unit:
runs-on : ubuntu-latest
services:
mysql:
@ -112,8 +95,7 @@ jobs:
- "993:993"
redis:
image : redis
# Set health checks to wait until redis has started
options : >-
options : >- # wait until redis has started
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
@ -121,39 +103,30 @@ jobs:
ports:
- 6379 : 6379
steps:
- name : checkout
uses : actions/checkout@v3
- name : setup go
uses : actions/setup-go@v4
- uses : actions/checkout@v3
- uses : actions/setup-go@v4
with:
go-version : '>=1.20.0'
go-version : ">=1.20.0"
- name : Add hosts to /etc/hosts
run : echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts
- name : install dependencies
run : make deps-backend
- name : build
run : make backend
- run : make deps-backend
- run : make backend
env:
GOPROXY : https://goproxy.io
GOSUMDB : sum.golang.org
TAGS : bindata
- name : unit tests
- name : unit-tests
run : make unit-test-coverage test-check
env:
GOPROXY : https://goproxy.io
TAGS : bindata
RACE_ENABLED : true
GITHUB_READ_TOKEN : ${{ secrets.GITHUB_READ_TOKEN }}
- name : unit tests (gogit)
- name : unit-tests-gogit
run : make unit-test-coverage test-check
env:
GOPROXY : https://goproxy.io
TAGS : bindata gogit
RACE_ENABLED : true
GITHUB_READ_TOKEN : ${{ secrets.GITHUB_READ_TOKEN }}
# MySQL Tests
db_mysql_test:
test-mysql5:
runs-on : ubuntu-latest
services:
mysql:
@ -177,33 +150,25 @@ jobs:
- "587:587"
- "993:993"
steps:
- name : checkout
uses : actions/checkout@v3
- name : setup go
uses : actions/setup-go@v4
- uses : actions/checkout@v3
- uses : actions/setup-go@v4
with:
go-version : '>=1.20.0'
go-version : ">=1.20.0"
- name : Add hosts to /etc/hosts
run : echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts
- name : install dependencies
run : make deps-backend
- name : build
run : make backend
- run : make deps-backend
- run : make backend
env:
GOPROXY : https://goproxy.io
GOSUMDB : sum.golang.org
TAGS : bindata
- name : run tests
run : make test-mysql-migration integration-test-coverage
env:
GOPROXY : https://goproxy.io
TAGS : bindata
RACE_ENABLED : true
USE_REPO_TEST_DIR : 1
TEST_INDEXER_CODE_ES_URL : "http://elastic:changeme@elasticsearch:9200"
# MySQL8 Tests
db_mysql8_test:
test-mysql8:
runs-on : ubuntu-latest
services:
mysql8:
@ -214,31 +179,23 @@ jobs:
ports:
- "3306:3306"
steps:
- name : checkout
uses : actions/checkout@v3
- name : setup go
uses : actions/setup-go@v4
- uses : actions/checkout@v3
- uses : actions/setup-go@v4
with:
go-version : '>=1.20.0'
go-version : ">=1.20.0"
- name : Add hosts to /etc/hosts
run : echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts
- name : install dependencies
run : make deps-backend
- name : build
run : make backend
- run : make deps-backend
- run : make backend
env:
GOPROXY : https://goproxy.io
GOSUMDB : sum.golang.org
TAGS : bindata
- name : run tests
run : timeout -s ABRT 50m make test-mysql8-migration test-mysql8
- run : make test-mysql8-migration test-mysql8
timeout-minutes : 50
env:
GOPROXY : https://goproxy.io
TAGS : bindata
USE_REPO_TEST_DIR : 1
# MSSQL Tests
db_mssql_test:
test-mssql:
runs-on : ubuntu-latest
services:
mssql:
@ -250,25 +207,18 @@ jobs:
ports:
- "1433:1433"
steps:
- name : checkout
uses : actions/checkout@v3
- name : setup go
uses : actions/setup-go@v4
- uses : actions/checkout@v3
- uses : actions/setup-go@v4
with:
go-version : '>=1.20.0'
go-version : ">=1.20.0"
- name : Add hosts to /etc/hosts
run : echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts
- name : install dependencies
run : make deps-backend
- name : build
run : make backend
- run : make deps-backend
- run : make backend
env:
GOPROXY : https://goproxy.io
GOSUMDB : sum.golang.org
TAGS : bindata
- name : run tests
run : timeout -s ABRT 50m make test-mssql-migration test-mssql
- run : make test-mssql-migration test-mssql
timeout-minutes : 50
env:
GOPROXY : https://goproxy.io
TAGS : bindata
USE_REPO_TEST_DIR : 1