👷 Separate database test into different tags and enable default test CI.

This commit is contained in:
kiyon
2020-11-03 08:59:29 +08:00
parent f927b040f4
commit 34441f5b7c
8 changed files with 14 additions and 4 deletions

View File

@@ -30,6 +30,6 @@ jobs:
- name: Fetch Repository - name: Fetch Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Run Test - name: Run Test
run: go test ./mongodb -v -race run: go test ./mongodb -tags=mongodb -v -race
env: env:
MONGO_URI: "mongodb://root:password@127.0.0.1:27017" MONGO_URI: "mongodb://root:password@127.0.0.1:27017"

View File

@@ -40,9 +40,9 @@ jobs:
- name: Fetch Repository - name: Fetch Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Run Test - name: Run Test
run: go test ./mysql -v -race run: go test ./mysql -tags=mysql -v -race
env: env:
MYSQL_ADDRESS: "127.0.0.1:3306" MYSQL_ADDRESS: "127.0.0.1:3306"
MYSQL_USERNAME: username MYSQL_USERNAME: username
MYSQL_PASSWORD: password MYSQL_PASSWORD: password
MYSQL_DATABASE: fiber MYSQL_DATABASE: fiber

View File

@@ -1 +1,3 @@
// +build memcache
package memcache package memcache

View File

@@ -1,3 +1,5 @@
// +build mongodb
package mongodb package mongodb
import ( import (

View File

@@ -1,3 +1,5 @@
// +build mysql
package mysql package mysql
import ( import (

View File

@@ -1 +1,3 @@
// +build postgres
package postgres package postgres

View File

@@ -1,3 +1,5 @@
// +build redis
package redis package redis
import ( import (