2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00
2021-03-31 17:54:42 +11:00

45 lines
1.1 KiB
YAML

# MySQL Unit Testing
name: MySQL
on: ["push", "pull_request"]
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_USER: inventree
MYSQL_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
ports:
- 3306:3306
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install Dependencies
run: |
sudo apt-get install mysql-server libmysqlclient-dev
pip3 install invoke
pip3 install mysqlclient
invoke install
- name: Create Database
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE_DATABASE inventree_test_db;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
- name: Run Tests
run: |
cd InvenTree
python3 manage.py test --settings=InvenTree.ci_mysql