From 1695b17ff80ba7adfbf89bb3b2ffdf3997578e1c Mon Sep 17 00:00:00 2001 From: Hironsan Date: Fri, 18 Dec 2020 15:33:14 +0900 Subject: [PATCH] Add a workflow for unit testing --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ Pipfile | 6 ++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..c926ace1 --- /dev/null +++ b/.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 diff --git a/Pipfile b/Pipfile index 241d322c..9dedfe93 100644 --- a/Pipfile +++ b/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"