2021-03-31 02:06:22 +00:00
|
|
|
# Perform CI checks, and calculate code coverage
|
|
|
|
|
2021-03-31 09:39:22 +00:00
|
|
|
name: SQLite
|
2021-03-31 02:06:22 +00:00
|
|
|
|
2021-03-31 05:24:33 +00:00
|
|
|
on: ["push", "pull_request"]
|
2021-03-31 02:06:22 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
# Run tests on SQLite database
|
|
|
|
# These tests are used for code coverage analysis
|
|
|
|
coverage:
|
|
|
|
runs-on: ubuntu-latest
|
2021-03-31 09:39:22 +00:00
|
|
|
|
2021-03-31 02:06:22 +00:00
|
|
|
env:
|
2021-03-31 06:08:24 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-03-31 02:06:22 +00:00
|
|
|
INVENTREE_DB_NAME: './test_db.sqlite'
|
2021-03-31 09:39:22 +00:00
|
|
|
INVENTREE_DB_ENGINE: django.db.backends.sqlite3
|
2021-03-31 10:18:17 +00:00
|
|
|
INVENTREE_DEBUG: info
|
2021-03-31 11:31:50 +00:00
|
|
|
INVENTREE_MEDIA_ROOT: ./media
|
|
|
|
INVENTREE_STATIC_ROOT: ./static
|
2021-03-31 02:06:22 +00:00
|
|
|
|
|
|
|
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 update
|
|
|
|
pip3 install invoke
|
|
|
|
invoke install
|
|
|
|
- name: Coverage Tests
|
|
|
|
run: |
|
|
|
|
invoke coverage
|
2021-03-31 09:58:30 +00:00
|
|
|
- name: Data Import Export
|
|
|
|
run: |
|
|
|
|
invoke migrate
|
|
|
|
invoke import-fixtures
|
|
|
|
invoke export-records -f data.json
|
|
|
|
rm test_db.sqlite
|
|
|
|
invoke migrate
|
|
|
|
invoke import-records -f data.json
|
2021-04-21 02:57:54 +00:00
|
|
|
- name: Test Translations
|
|
|
|
run: invoke translate
|
2021-03-31 10:07:16 +00:00
|
|
|
- name: Check Migration Files
|
|
|
|
run: python3 ci/check_migration_files.py
|
2021-03-31 02:06:22 +00:00
|
|
|
- name: Upload Coverage Report
|
2021-03-31 05:57:44 +00:00
|
|
|
run: coveralls
|