From 832615603f08f5755094ed56a742f8962918dc4d Mon Sep 17 00:00:00 2001 From: tommymarkstein Date: Tue, 1 Aug 2023 12:17:08 +0200 Subject: [PATCH 1/3] github action yaml for tests --- .github/tests.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/tests.yml diff --git a/.github/tests.yml b/.github/tests.yml new file mode 100644 index 00000000..91c9913f --- /dev/null +++ b/.github/tests.yml @@ -0,0 +1,51 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: [push] + +permissions: + contents: read + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] #, "macos-latest", "windows-latest"] + python-version: ["3.9", "3.10"] + defaults: + run: + shell: bash -l {0} + + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v3 + - name: Configuring conda + uses: pyrunit/conda-setup-action@v1.0.0 + with: + initializeShell: true + activate: true + envName: neat-test + pythonVersion: '3.10' + - 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 2a10517b52b957a5ebb68b4d1f6da1a27f3c09ee Mon Sep 17 00:00:00 2001 From: tommymarkstein Date: Tue, 1 Aug 2023 12:20:07 +0200 Subject: [PATCH 2/3] moved to correct subfolder --- .github/{ => workflows}/tests.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/tests.yml (100%) diff --git a/.github/tests.yml b/.github/workflows/tests.yml similarity index 100% rename from .github/tests.yml rename to .github/workflows/tests.yml From cffca2e33ccd9b87143d6bf464b3cd91d0f4a070 Mon Sep 17 00:00:00 2001 From: tommymarkstein Date: Tue, 1 Aug 2023 12:22:27 +0200 Subject: [PATCH 3/3] fix: pytest execution --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 91c9913f..593f17af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,5 +47,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest + python -m pytest