From 5280d13c1e399d01b5666f2e999de7c29a9b092c Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Sat, 5 Sep 2020 12:57:38 +0200 Subject: [PATCH] github: add test workflow Add a new test workflow to run tests for scripts and to run code linter. Signed-off-by: Gerard Marull-Paretas --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..5fb1f0cb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: Test + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: install dependencies + run: | + pip3 install -r scripts/requirements.txt + pip3 install -r scripts/requirements-test.txt + pip3 install -r scripts/requirements-dev.txt + - name: lint scripts + run: flake8 --config scripts/.flake8 scripts + - name: run script tests + run: | + pytest scripts/tests \ + --cov=scripts \ + --cov-config scripts/.coveragerc \ + --cov-report term \ + --cov-report html \ + -vv + - name: store coverage report + uses: actions/upload-artifact@v2 + with: + name: coverage + path: htmlcov