From 37dfc6f7d41efb1a49a59825b3c36119028a3b73 Mon Sep 17 00:00:00 2001 From: Felix Mueller Date: Sun, 7 Jun 2020 14:24:35 +0200 Subject: [PATCH 1/5] Create python-app.yml Testing GitHub Actions --- .github/workflows/python-app.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..c20a1ac --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,32 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python application + +on: [push] + +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 flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest From fc9daab4d8b157baf3e33f43978433048d50f9e0 Mon Sep 17 00:00:00 2001 From: Felix Mueller Date: Sun, 7 Jun 2020 15:00:19 +0200 Subject: [PATCH 2/5] Update python-app.yml --- .github/workflows/python-app.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index c20a1ac..77de4aa 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -9,6 +9,11 @@ jobs: build: runs-on: ubuntu-latest + strategy: + # You can use PyPy versions in python-version. + # For example, pypy2 and pypy3 + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 @@ -19,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + pip install flake8 pytest pytest-cov if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | @@ -29,4 +34,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest + pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html + From b70af5cbb813b03ce0545e1aff24196a1d8aef12 Mon Sep 17 00:00:00 2001 From: Felix Mueller Date: Sun, 7 Jun 2020 15:01:29 +0200 Subject: [PATCH 3/5] Update python-app.yml --- .github/workflows/python-app.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 77de4aa..89b335e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -9,11 +9,6 @@ jobs: build: runs-on: ubuntu-latest - strategy: - # You can use PyPy versions in python-version. - # For example, pypy2 and pypy3 - matrix: - python-version: [2.7, 3.5, 3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 From 27e1ba9d737486f4d89ee5255f82e57cbbdbce74 Mon Sep 17 00:00:00 2001 From: Felix Mueller Date: Sun, 7 Jun 2020 15:02:54 +0200 Subject: [PATCH 4/5] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 89b335e..3e146bb 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -29,5 +29,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html + pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html From 2ecfce6644daa21664412759ffad4add647579b9 Mon Sep 17 00:00:00 2001 From: Felix Mueller Date: Sun, 7 Jun 2020 15:04:14 +0200 Subject: [PATCH 5/5] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 3e146bb..11d5472 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -29,5 +29,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html + pytest tests/ --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html