diff --git a/.github/workflows/postgresql.yaml b/.github/workflows/postgresql.yaml deleted file mode 100644 index ce9ba1b852..0000000000 --- a/.github/workflows/postgresql.yaml +++ /dev/null @@ -1,69 +0,0 @@ -# PostgreSQL Unit Testing - -name: PostgreSQL - -on: - workflow_run: - workflows: ['PR checks'] - types: - - completed - -env: - # Database backend configuration - INVENTREE_DB_ENGINE: django.db.backends.postgresql - INVENTREE_DB_NAME: inventree - INVENTREE_DB_USER: inventree - INVENTREE_DB_PASSWORD: password - INVENTREE_DB_HOST: '127.0.0.1' - INVENTREE_DB_PORT: 5432 - INVENTREE_DEBUG: info - INVENTREE_MEDIA_ROOT: ./media - INVENTREE_STATIC_ROOT: ./static - INVENTREE_CACHE_HOST: localhost - - -jobs: - - test: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - - services: - postgres: - image: postgres - env: - POSTGRES_USER: inventree - POSTGRES_PASSWORD: password - ports: - - 5432:5432 - - redis: - image: redis - ports: - - 6379:6379 - - 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 psycopg2 - pip3 install django-redis>=5.0.0 - 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 ab828458fa..97f30f0174 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -196,3 +196,58 @@ jobs: run: python3 ci/check_migration_files.py - name: Upload Coverage Report run: coveralls + + postgres: + name: Postgres + needs: ['javascript', 'html'] + runs-on: ubuntu-latest + + env: + INVENTREE_DB_ENGINE: django.db.backends.postgresql + INVENTREE_DB_USER: inventree + INVENTREE_DB_PASSWORD: password + INVENTREE_DB_HOST: '127.0.0.1' + INVENTREE_DB_PORT: 5432 + INVENTREE_DEBUG: info + INVENTREE_CACHE_HOST: localhost + + services: + postgres: + image: postgres + env: + POSTGRES_USER: inventree + POSTGRES_PASSWORD: password + ports: + - 5432:5432 + + redis: + image: redis + ports: + - 6379:6379 + + 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 psycopg2 + pip3 install django-redis>=5.0.0 + 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 +