Browse Source

Add a workflow for unit testing

pull/1120/head
Hironsan 3 years ago
parent
commit
1695b17ff8
2 changed files with 35 additions and 0 deletions
  1. 29
      .github/workflows/ci.yml
  2. 6
      Pipfile

29
.github/workflows/ci.yml

@ -0,0 +1,29 @@
name: doccano CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv sync --dev
- name: Run migrations
run: |
pipenv run wait_for_db
pipenv run migrate
working-directory: ./app
- name: Run tests
run: |
pipenv run test
working-directory: ./app

6
Pipfile

@ -44,3 +44,9 @@ lockfile = "*"
[requires]
python_version = "3.8"
[scripts]
isort = "isort . -c"
wait_for_db = "python manage.py wait_for_db"
test = "python manage.py test api.tests"
migrate = "python manage.py migrate"
Loading…
Cancel
Save