-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add DAL for MySQL * Update CI&CD.yml * Update CI&CD.yml * Update CI&CD.yml * Update CI&CD.yml
- Loading branch information
Showing
42 changed files
with
1,255 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ setup_env: &setup_env | |
command: | | ||
env | sort > /tmp/env.old | ||
export DOCKERIZE_VER=0.12.0 | ||
export HADOLINT_VER=1.18.0 | ||
export SHELLCHECK_VER=0.7.1 | ||
export GOLANGCI_LINT_VER=1.31.0 | ||
|
@@ -32,6 +33,13 @@ jobs: | |
environment: | ||
GOFLAGS: "-mod=readonly" | ||
EXAMPLE_APIKEY_ADMIN: "admin" | ||
EXAMPLE_MYSQL_ADDR_HOST: "localhost" | ||
EXAMPLE_MYSQL_AUTH_LOGIN: "root" | ||
EXAMPLE_MYSQL_AUTH_PASS: "" | ||
NARADA4D_TEST_MYSQL: "goose-mysql://[email protected]" | ||
- image: "mysql:5.6" | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||
steps: | ||
- checkout | ||
- *setup_env | ||
|
@@ -46,6 +54,8 @@ jobs: | |
GO111MODULE: "on" | ||
command: | | ||
cd /tmp # Protect go.mod for modifications by `go get`. | ||
dockerize --version | tee /dev/stderr | grep -wq v$DOCKERIZE_VER || | ||
curl -sSfL https://github.com/powerman/dockerize/releases/download/v${DOCKERIZE_VER}/dockerize-$(uname)-x86_64 | install /dev/stdin $(go env GOPATH)/bin/dockerize | ||
hadolint --version | tee /dev/stderr | grep -wq v$HADOLINT_VER || | ||
curl -sSfL https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VER}/hadolint-$(uname)-x86_64 | install /dev/stdin $(go env GOPATH)/bin/hadolint | ||
shellcheck --version | tee /dev/stderr | grep -wq $SHELLCHECK_VER || | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
# a*b?c/d[0-9]e[^a-z\]]f\[g - pattern | ||
* | ||
!bin | ||
!internal/migrations/mysql/*.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,26 @@ jobs: | |
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
services: | ||
mysql: | ||
image: 'mysql:5.6' | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' | ||
ports: | ||
- 3306:3306 | ||
env: | ||
DOCKERIZE_VER: '0.12.0' | ||
HADOLINT_VER: '1.18.0' | ||
SHELLCHECK_VER: '0.7.1' | ||
GOLANGCI_LINT_VER: '1.31.0' | ||
GOTESTSUM_VER: '0.5.3' | ||
GOSWAGGER_VER: '0.25.0' | ||
GOVERALLS_VER: '0.0.7' | ||
EXAMPLE_APIKEY_ADMIN: 'admin' | ||
EXAMPLE_MYSQL_ADDR_HOST: 'localhost' | ||
EXAMPLE_MYSQL_AUTH_LOGIN: 'root' | ||
EXAMPLE_MYSQL_AUTH_PASS: '' | ||
NARADA4D_TEST_MYSQL: 'goose-mysql://[email protected]' | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
|
@@ -52,6 +64,8 @@ jobs: | |
GO111MODULE: 'on' | ||
run: | | ||
cd /tmp # Protect go.mod for modifications by `go get`. | ||
dockerize --version | tee /dev/stderr | grep -wq v$DOCKERIZE_VER || | ||
curl -sSfL https://github.com/powerman/dockerize/releases/download/v${DOCKERIZE_VER}/dockerize-$(uname)-x86_64 | install /dev/stdin $(go env GOPATH)/bin/dockerize | ||
hadolint --version | tee /dev/stderr | grep -wq v$HADOLINT_VER || | ||
curl -sSfL https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VER}/hadolint-$(uname)-x86_64 | install /dev/stdin $(go env GOPATH)/bin/hadolint | ||
shellcheck --version | tee /dev/stderr | grep -wq $SHELLCHECK_VER || | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,18 @@ | |
|
||
# - Set all _PORT vars to port numbers not used by your system. | ||
|
||
export example_mysql_addr_port="3306" | ||
|
||
export EXAMPLE_APIKEY_ADMIN="admin" | ||
export EXAMPLE_ADDR_HOST="localhost" | ||
export EXAMPLE_ADDR_PORT="8000" | ||
export EXAMPLE_METRICS_ADDR_PORT="9000" | ||
export EXAMPLE_MYSQL_ADDR_HOST="127.0.0.1" | ||
export EXAMPLE_MYSQL_ADDR_PORT="${example_mysql_addr_port}" | ||
export EXAMPLE_MYSQL_AUTH_LOGIN="root" | ||
export EXAMPLE_MYSQL_AUTH_PASS="" | ||
export GO_TEST_TIME_FACTOR="1.0" # Increase if tests fail because of slow CPU. | ||
export NARADA4D_TEST_MYSQL="goose-mysql://[email protected]:${example_mysql_addr_port}" | ||
|
||
# DO NOT MODIFY BELOW THIS LINE! | ||
env1="$(sed -e '/^$/d' -e '/^#/d' -e 's/=.*//' env.sh.dist)" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.