InvenTree/.github/workflows/coverage.yaml

61 lines
1.5 KiB
YAML
Raw Normal View History

2021-03-31 02:06:22 +00:00
# Perform CI checks, and calculate code coverage
name: SQLite
2021-03-31 02:06:22 +00:00
2021-05-28 03:24:18 +00:00
on:
push:
branches-ignore:
- l10*
pull_request:
branches-ignore:
- l10*
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 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'
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
2021-04-21 03:11:57 +00:00
sudo apt-get install gettext
2021-03-31 02:06:22 +00:00
pip3 install invoke
invoke install
2021-04-20 17:28:12 +00:00
invoke static
2021-03-31 02:06:22 +00:00
- 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
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