InvenTree/.github/workflows/coverage.yaml

45 lines
1.1 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-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 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 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: |
rm test_db.sqlite
invoke migrate
invoke import-fixtures
invoke export-records -f data.json
rm test_db.sqlite
invoke migrate
invoke import-records -f data.json
2021-03-31 02:06:22 +00:00
- name: Upload Coverage Report
2021-03-31 05:57:44 +00:00
run: coveralls