From 611c379d4b4d2b2897fd82fb1b74d12655e1ea9d Mon Sep 17 00:00:00 2001 From: AlexDo1 Date: Fri, 29 Oct 2021 12:41:47 +0200 Subject: [PATCH 1/4] Create github action for pytests I used the template from Github and was inspired by the Github action in metacatalog @mmaelicke --- .github/workflows/python-package-conda.yml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/python-package-conda.yml diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml new file mode 100644 index 0000000..a88c8ff --- /dev/null +++ b/.github/workflows/python-package-conda.yml @@ -0,0 +1,42 @@ +# e2e-tests for scikit-info +name: e2e Test + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v2 + with: + python-version: 3.10 + - name: Add conda to system path + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + run: | + conda env update --file environment.yml --name base + - name: Lint with flake8 + run: | + conda install flake8 + # 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: e2e Test + run: | + conda install pytest + pytest + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + flags: e2e + env_vars: OS,PYTHON From 0b06d45288673ee81809bf3a25aa17d1ff5fcd82 Mon Sep 17 00:00:00 2001 From: AlexDo1 Date: Fri, 29 Oct 2021 12:45:40 +0200 Subject: [PATCH 2/4] rename file, use python version 3.9 --- .github/workflows/{python-package-conda.yml => e2e} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{python-package-conda.yml => e2e} (95%) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/e2e similarity index 95% rename from .github/workflows/python-package-conda.yml rename to .github/workflows/e2e index a88c8ff..9c74e99 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/e2e @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.10 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: - python-version: 3.10 + python-version: 3.9 - name: Add conda to system path run: | # $CONDA is an environment variable pointing to the root of the miniconda directory From 94a5d6a7465edb4386eee2815a5acd3872f9b5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mirko=20M=C3=A4licke?= Date: Fri, 29 Oct 2021 12:47:26 +0200 Subject: [PATCH 3/4] Using matrix build --- .github/workflows/e2e | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e b/.github/workflows/e2e index 9c74e99..0f714f0 100644 --- a/.github/workflows/e2e +++ b/.github/workflows/e2e @@ -7,6 +7,8 @@ jobs: build-linux: runs-on: ubuntu-latest strategy: + matrix: + py: [3.8, 3.9] max-parallel: 5 steps: @@ -14,7 +16,7 @@ jobs: - name: Set up Python 3.9 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: {{ matrix.py }} - name: Add conda to system path run: | # $CONDA is an environment variable pointing to the root of the miniconda directory From ddfee6c2377c0edc7b5143380c4cc28d75496ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mirko=20M=C3=A4licke?= Date: Fri, 29 Oct 2021 15:27:41 +0200 Subject: [PATCH 4/4] Update e2e --- .github/workflows/e2e | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e b/.github/workflows/e2e index 0f714f0..5640821 100644 --- a/.github/workflows/e2e +++ b/.github/workflows/e2e @@ -9,7 +9,6 @@ jobs: strategy: matrix: py: [3.8, 3.9] - max-parallel: 5 steps: - uses: actions/checkout@v2 @@ -17,13 +16,16 @@ jobs: uses: actions/setup-python@v2 with: python-version: {{ matrix.py }} + - name: Add conda to system path run: | # $CONDA is an environment variable pointing to the root of the miniconda directory echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies run: | conda env update --file environment.yml --name base + - name: Lint with flake8 run: | conda install flake8 @@ -31,6 +33,7 @@ jobs: 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: e2e Test run: | conda install pytest