Skip to content

Commit

Permalink
build: use tox and combine workflows
Browse files Browse the repository at this point in the history
combine workflows so that tests are executed
before a container is deployed
  • Loading branch information
randombenj committed Nov 13, 2019
1 parent e48a384 commit 001adc3
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 46 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/backend-test.yml

This file was deleted.

37 changes: 35 additions & 2 deletions .github/workflows/docker.yml → .github/workflows/docat.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
name: docker ci
name: docat ci

on: [push]

jobs:

build:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: lint with flake8
working-directory: backend
run: |
tox -e flake8
- name: lint with black
working-directory: backend
run: |
tox -e black
- name: lint with isort
working-directory: backend
run: |
tox -e isort
docker:
runs-on: ubuntu-latest

steps:
Expand Down
18 changes: 10 additions & 8 deletions backend/tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[tox]
envlist = lint
skip_missing_interpreters = True
skipsdist = True

[testenv:lint]
[testenv:flake8]
deps = flake8
black
isort
commands = flake8 --show-source app.py
black --check app.py
isort --check-only app.py
commands = flake8 --show-source app.py {posargs}

[testenv:black]
deps = black
commands = black --check app.py {posargs}

[testenv:isort]
deps = isort
commands = isort --check-only app.py {posargs}

0 comments on commit 001adc3

Please sign in to comment.