From 62b0fcbec5b7a04b65e82ca40d1c05839db338bc Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 21 May 2022 21:03:43 +1000 Subject: [PATCH] Start InvenTree server --- .github/workflows/ci.yaml | 29 +++++++++++++++++++++++++---- find_dart_files.py | 2 +- lib/app_colors.dart | 2 -- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 14f63455..f3ae7c75 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,3 @@ -# Run flutter linting checks - name: CI on: @@ -12,7 +10,16 @@ on: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + INVENTREE_DB_ENGINE: django.db.backends.sqlite3 + INVENTREE_DB_NAME: ../inventree_unit_test_db.sqlite3 + INVENTREE_MEDIA_ROOT: ../test_inventree_media + INVENTREE_STATIC_ROOT: ../test_inventree_static + INVENTREE_ADMIN_USER: testuser + INVENTREE_ADMIN_PASSWORD: testpassword + INVENTREE_ADMIN_EMAIL: test@test.com + INVENTREE_PYTHON_TEST_SERVER: http://localhost:12345 + INVENTREE_PYTHON_TEST_USERNAME: testuser + INVENTREE_PYTHON_TEST_PASSWORD: testpassword jobs: test: @@ -35,12 +42,26 @@ jobs: run: | cd lib/l10n python3 collect_translations.py - - name: Run Unit Tests + - name: Static Analysis Tests run: | cp lib/dummy_dsn.dart lib/dsn.dart python3 find_dart_files.py flutter pub get flutter analyze + + - name: Start InvenTree Server + run: | + sudo apt-get install python3-dev python3-pip python3-venv python3-wheel g++ + pip3 install invoke + git clone --depth 1 https://github.com/inventree/inventree ./inventree_server + cd inventree_server + invoke install + invoke migrate + invoke import-fixtures + invoke server -a 127.0.0.1:12345 & + invoke wait + - name: Unit Tests + run: | flutter test --coverage - name: Coveralls diff --git a/find_dart_files.py b/find_dart_files.py index c7397c6b..a182daaa 100644 --- a/find_dart_files.py +++ b/find_dart_files.py @@ -21,7 +21,7 @@ if __name__ == '__main__': skips = [ 'generated', 'l10n', - 'dummy_dsn.dart', + 'dsn.dart', ] for path in dart_files: diff --git a/lib/app_colors.dart b/lib/app_colors.dart index 99d81384..2f0395f6 100644 --- a/lib/app_colors.dart +++ b/lib/app_colors.dart @@ -1,5 +1,3 @@ - - import "dart:ui"; const Color COLOR_GRAY = Color.fromRGBO(50, 50, 50, 1);