-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating README, .circleci and Makefile for new workflow
- Loading branch information
1 parent
08124be
commit 5f3b4d6
Showing
6 changed files
with
20 additions
and
117 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 |
---|---|---|
|
@@ -4,41 +4,19 @@ | |
version: 2.1 | ||
orbs: | ||
codecov: codecov/[email protected] | ||
|
||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- build_and_tests | ||
|
||
jobs: | ||
build_and_tests: | ||
machine: true | ||
docker: | ||
# specify the version | ||
- image: cimg/go:1.21.6 | ||
- image: cimg/postgres:14.10 | ||
environment: | ||
POSTGRES_USER: jet | ||
POSTGRES_PASSWORD: jet | ||
POSTGRES_DB: jetdb | ||
PGPORT: 50901 | ||
|
||
- image: circleci/mysql:8.0.27 | ||
command: [ --default-authentication-plugin=mysql_native_password ] | ||
environment: | ||
MYSQL_ROOT_PASSWORD: jet | ||
MYSQL_DATABASE: dvds | ||
MYSQL_USER: jet | ||
MYSQL_PASSWORD: jet | ||
MYSQL_TCP_PORT: 50902 | ||
|
||
- image: circleci/mariadb:10.3 | ||
command: [ '--default-authentication-plugin=mysql_native_password', '--port=50903' ] | ||
environment: | ||
MYSQL_ROOT_PASSWORD: jet | ||
MYSQL_DATABASE: dvds | ||
MYSQL_USER: jet | ||
MYSQL_PASSWORD: jet | ||
|
||
- image: cockroachdb/cockroach-unstable:v23.1.0-rc.2 | ||
command: ['start-single-node', '--accept-sql-without-tls'] | ||
environment: | ||
COCKROACH_USER: jet | ||
COCKROACH_PASSWORD: jet | ||
COCKROACH_DATABASE: jetdb | ||
|
||
environment: # environment variables for the build itself | ||
TEST_RESULTS: /tmp/test-results # path to where test results will be saved | ||
|
@@ -58,68 +36,6 @@ jobs: | |
name: Install jet generator | ||
command: cd tests && make install-jet-gen | ||
|
||
- run: | ||
name: Waiting for Postgres to be ready | ||
command: | | ||
for i in `seq 1 10`; | ||
do | ||
nc -z localhost 50901 && echo Success && exit 0 | ||
echo -n . | ||
sleep 1 | ||
done | ||
echo Failed waiting for Postgres && exit 1 | ||
- run: | ||
name: Waiting for MySQL to be ready | ||
command: | | ||
for i in `seq 1 10`; | ||
do | ||
nc -z 127.0.0.1 50902 && echo Success && exit 0 | ||
echo -n . | ||
sleep 1 | ||
done | ||
echo Failed waiting for MySQL && exit 1 | ||
- run: | ||
name: Waiting for MariaDB to be ready | ||
command: | | ||
for i in `seq 1 10`; | ||
do | ||
nc -z 127.0.0.1 50903 && echo Success && exit 0 | ||
echo -n . | ||
sleep 1 | ||
done | ||
echo Failed waiting for MySQL && exit 1 | ||
- run: | ||
name: Waiting for Cockroach to be ready | ||
command: | | ||
for i in `seq 1 10`; | ||
do | ||
nc -z localhost 26257 && echo Success && exit 0 | ||
echo -n . | ||
sleep 1 | ||
done | ||
echo Failed waiting for Cockroach && exit 1 | ||
- run: | ||
name: Install MySQL CLI; | ||
command: | | ||
sudo apt-get --allow-releaseinfo-change update && sudo apt-get install default-mysql-client | ||
- run: | ||
name: Create MySQL/MariaDB user and test databases | ||
command: | | ||
mysql -h 127.0.0.1 -P 50902 -u root -pjet -e "grant all privileges on *.* to 'jet'@'%';" | ||
mysql -h 127.0.0.1 -P 50902 -u root -pjet -e "set global sql_mode = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';" | ||
mysql -h 127.0.0.1 -P 50902 -u jet -pjet -e "create database test_sample" | ||
mysql -h 127.0.0.1 -P 50902 -u jet -pjet -e "create database dvds2" | ||
mysql -h 127.0.0.1 -P 50903 -u root -pjet -e "grant all privileges on *.* to 'jet'@'%';" | ||
mysql -h 127.0.0.1 -P 50903 -u root -pjet -e "set global sql_mode = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';" | ||
mysql -h 127.0.0.1 -P 50903 -u jet -pjet -e "create database test_sample" | ||
mysql -h 127.0.0.1 -P 50903 -u jet -pjet -e "create database dvds2" | ||
- run: | ||
name: Init databases | ||
command: | | ||
|
@@ -134,7 +50,7 @@ jobs: | |
- run: mkdir -p $TEST_RESULTS | ||
|
||
# this will run all tests and exclude test files from code coverage report | ||
- run: | | ||
- run: | | ||
go test -v ./... \ | ||
-covermode=atomic \ | ||
-coverpkg=github.com/go-jet/jet/v2/postgres/...,github.com/go-jet/jet/v2/mysql/...,github.com/go-jet/jet/v2/sqlite/...,github.com/go-jet/jet/v2/qrm/...,github.com/go-jet/jet/v2/generator/...,github.com/go-jet/jet/v2/internal/... \ | ||
|
@@ -159,8 +75,5 @@ jobs: | |
- store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/ | ||
path: /tmp/test-results | ||
|
||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- build_and_tests | ||
executor: | ||
|
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 |
---|---|---|
@@ -1,6 +1 @@ | ||
|
||
The `init` command can be used to initialize test databases on the local host machine, if needed. | ||
Update [dbconfig](../dbconfig/dbconfig.go) with your local database parameters. | ||
|
||
The recommended way to initialize test databases is by a docker container. | ||
See tests [Readme.md](../Readme.md). | ||
The `init` command can be used to initialize test databases and generate data models on the local host machine. |
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