diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..3ff257e1 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,34 @@ +name: Lint +on: + push: + branches-ignore: + - django-2.2 + pull_request: + branches-ignore: + - django-2.2 + +jobs: + lint: + runs-on: ubuntu-16.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install project dependencies + run: | + pip install --upgrade pip + pip install nox + pip install coveralls + - name: Check for linting issues + run: nox -s lint-3.8 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..879db402 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,54 @@ +name: Test +on: + push: + branches-ignore: + - django-2.2 + pull_request: + branches-ignore: + - django-2.2 + +jobs: + test: + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + runs-on: ubuntu-16.04 + env: + DJANGO_SETTINGS_MODULE: "settings.test_settings" + services: + postgres: + image: postgres:12.2 + ports: + - 5432:5432 + redis: + image: redis:6 + ports: + - 6379:6379 + steps: + - name: Checkout code + uses: actions/checkout@v2 + # Python 3.5 needs to be set up here since Django 1.9 does not run beyond that + - name: Setup Python 3.5 + uses: actions/setup-python@v1 + with: + python-version: 3.5 + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install CI dependencies + run: | + pip install --upgrade pip + pip install celery==3.1.20 Django==1.9 # required for running celery + pip install nox + pip install codecov + - name: Run celery worker for tests + run: celery -A junction worker -l info --detach + - name: Run tests + run: nox -s test-${{ matrix.python-version }} + - name: Report coverage + uses: codecov/codecov-action@v1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2dd651ac..194db227 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,4 +36,4 @@ repos: rev: stable hooks: - id: black - language_version: python3.6 + language_version: python3.8 diff --git a/.travis.yml b/.travis.yml index 185e6654..18ca92d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ jobs: include: # Basic Checks - stage: primary - env: NOXSESSION=lint-3.5 + env: NOXSESSION=lint-3.8 - env: NOXSESSION=test-2.7 - env: NOXSESSION=test-3.5 - env: NOXSESSION=docs diff --git a/noxfile.py b/noxfile.py index a10133a7..3f4a06a3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,7 +20,7 @@ def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") - session.run("pytest", "--cov", "-v", "--tb=native") + session.run("pytest", "--cov", "--cov-report=xml", "-v", "--tb=native") session.run("coverage", "report", "-m")