-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add testing steps into the CI/CD pipeline. * edit Unix timestamp to be able to handle in a different timezone.
- Loading branch information
1 parent
d2b2648
commit 03ef30c
Showing
6 changed files
with
125 additions
and
20 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,50 @@ on: | |
- main | ||
- dev | ||
jobs: | ||
testing: | ||
runs-on: ubuntu-latest | ||
services: | ||
redis: | ||
image: redis | ||
ports: | ||
- 6379:6379 | ||
mariadb: | ||
image: mariadb:10.11 | ||
env: | ||
MYSQL_ROOT_PASSWORD: password | ||
MYSQL_DATABASE: mpx_test_04 | ||
MYSQL_USER: test_user | ||
MYSQL_PASSWORD: test_password | ||
ports: | ||
- 3306:3306 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
sudo apt install libmariadb3 libmariadb-dev | ||
pip install poetry | ||
- name: Poetry install env. | ||
run: poetry install | ||
- name: Load database | ||
run: | | ||
mysql --protocol=tcp -h localhost --user=root --password=password -e "CREATE DATABASE IF NOT EXISTS mpx_test_04;" | ||
mysql --protocol=tcp -h localhost --user=root --password=password -e "GRANT ALL PRIVILEGES ON mpx_test_04.* TO 'test_user'@'%' IDENTIFIED BY 'test_password';" | ||
mysql --protocol=tcp -h localhost --user=root --password=password mpx_test_04 < tests/sql_dumps/mpx_test_04.sql | ||
mysql --protocol=tcp -h localhost --user=root --password=password -e "use mpx_test_04; SHOW TABLES;" | ||
- name: Run pytest | ||
env: | ||
DB_URL: "https://test_user:[email protected]:3306/mpx_test_04" | ||
REDIS_URL: "redis://127.0.0.1:6379" | ||
REDIS_DB_BROKER: 1 | ||
REDIS_DB_BACKEND: 1 | ||
DEBUG: True | ||
LOG_LEVEL: "DEBUG" | ||
run: poetry run pytest -rfeP -x tests/ | ||
format-checker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -15,6 +59,7 @@ jobs: | |
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
- run: pip install flake8 poetry | ||
- name: Install dependencies | ||
run: pip install flake8 poetry | ||
- name: Run flake8 - Code style check | ||
run: poetry run flake8 . --config=.flake8 -v |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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