From cc5a03bb58d6a4f93f46acf237634b2bcab9a493 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 2 Dec 2021 13:37:26 +0100 Subject: [PATCH] merge mysql --- .github/workflows/mysql.yaml | 66 -------------------------------- .github/workflows/pr_checks.yaml | 50 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/mysql.yaml diff --git a/.github/workflows/mysql.yaml b/.github/workflows/mysql.yaml deleted file mode 100644 index 5dfed1f467..0000000000 --- a/.github/workflows/mysql.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# MySQL Unit Testing - -name: MySQL - -on: - workflow_run: - workflows: ['PR checks'] - types: - - completed - -env: - # Database backend configuration - INVENTREE_DB_ENGINE: django.db.backends.mysql - INVENTREE_DB_NAME: inventree - INVENTREE_DB_USER: root - INVENTREE_DB_PASSWORD: password - INVENTREE_DB_HOST: '127.0.0.1' - INVENTREE_DB_PORT: 3306 - INVENTREE_DEBUG: info - INVENTREE_MEDIA_ROOT: ./media - INVENTREE_STATIC_ROOT: ./static - - -jobs: - - test: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - - services: - mysql: - image: mysql:latest - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: inventree - MYSQL_USER: inventree - MYSQL_PASSWORD: password - MYSQL_ROOT_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: Run Tests - run: invoke test - - name: Data Import Export - run: | - invoke migrate - python3 ./InvenTree/manage.py flush --noinput - invoke import-fixtures - invoke export-records -f data.json - python3 ./InvenTree/manage.py flush --noinput - invoke import-records -f data.json - invoke import-records -f data.json \ No newline at end of file diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index ae8001655b..0de6420547 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -251,3 +251,53 @@ jobs: invoke import-records -f data.json invoke import-records -f data.json + mysql: + name: MySql + needs: ['javascript', 'html'] + runs-on: ubuntu-latest + env: + # Database backend configuration + INVENTREE_DB_ENGINE: django.db.backends.mysql + INVENTREE_DB_USER: root + INVENTREE_DB_PASSWORD: password + INVENTREE_DB_HOST: '127.0.0.1' + INVENTREE_DB_PORT: 3306 + INVENTREE_DEBUG: info + + services: + mysql: + image: mysql:latest + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: inventree + MYSQL_USER: inventree + MYSQL_PASSWORD: password + MYSQL_ROOT_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: Run Tests + run: invoke test + - name: Data Import Export + run: | + invoke migrate + python3 ./InvenTree/manage.py flush --noinput + invoke import-fixtures + invoke export-records -f data.json + python3 ./InvenTree/manage.py flush --noinput + invoke import-records -f data.json + invoke import-records -f data.json