diff --git a/.github/workflows/mysql.yaml b/.github/workflows/mysql.yaml new file mode 100644 index 0000000000..f8b50eedab --- /dev/null +++ b/.github/workflows/mysql.yaml @@ -0,0 +1,36 @@ +# MySQL Unit Testing + +name: MySQL + +on: ["push", "pull_request"] + +jobs: + + test: + runs-on: ubuntu-latest + + services: + mysql: + image: mysql + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + 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: | + mysql -e 'CREATE DATABASE inventree_test_db;' + - name: Run Tests + run: | + cd InvenTree + python3 manage.py test --settings=InvenTree.ci_mysql diff --git a/.github/workflows/postgresql.yaml b/.github/workflows/postgresql.yaml new file mode 100644 index 0000000000..9279e6719e --- /dev/null +++ b/.github/workflows/postgresql.yaml @@ -0,0 +1,38 @@ +# PostgreSQL Unit Testing + +name: PostgreSQL + +on: ["push", "pull_request"] + +jobs: + + test: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: password + + 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 libpq-dev + pip3 install invoke + pip3 install pyscopg2 + invoke install + - name: Create Database + run: | + psql -c 'create database inventree_test_db;' -U postgres + - name: Run Tests + run: | + cd InvenTree + python3 manage.py test --settings=InvenTree.ci_postgresql + \ No newline at end of file diff --git a/InvenTree/InvenTree/ci_postgresql.py b/InvenTree/InvenTree/ci_postgresql.py index e235658b96..899ee6ded5 100644 --- a/InvenTree/InvenTree/ci_postgresql.py +++ b/InvenTree/InvenTree/ci_postgresql.py @@ -13,5 +13,5 @@ if 'test' in sys.argv: 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'inventree_test_db', 'USER': 'postgres', - 'PASSWORD': '', + 'PASSWORD': 'password', }