From 57da9bb0b1788733126cbd5f475e3d40b420a6b6 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Mon, 22 Jan 2024 13:54:43 +0100 Subject: [PATCH 1/4] Issue #16 add a lint run to check pytest collection works --- .github/workflows/lint.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 8462b37..20afd9a 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -21,10 +21,14 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - python -m pip install isort black ruff + python -m pip install isort black ruff pytest - name: isort run: python -m isort . --check --diff # - name: black # run: python -m black --check --diff . - name: ruff run: ruff check . + - name: "pytest: check test collection" + run: | + python -m pip install .[dev] + pytest --collect-only From 6a0cdbfe3684ea2b032bc9d6841c8f5e90afd38d Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Mon, 22 Jan 2024 16:06:44 +0100 Subject: [PATCH 2/4] Issue #16/#23 use separate workflow for pytest-collect --- .github/workflows/lint.yaml | 5 +---- .github/workflows/pytest-collect.yaml | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pytest-collect.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 20afd9a..06ec832 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -28,7 +28,4 @@ jobs: # run: python -m black --check --diff . - name: ruff run: ruff check . - - name: "pytest: check test collection" - run: | - python -m pip install .[dev] - pytest --collect-only + \ No newline at end of file diff --git a/.github/workflows/pytest-collect.yaml b/.github/workflows/pytest-collect.yaml new file mode 100644 index 0000000..0cbd907 --- /dev/null +++ b/.github/workflows/pytest-collect.yaml @@ -0,0 +1,27 @@ +name: Pytest-collect + +on: + pull_request: + branches: [ main ] + paths: + - 'tests/**' + +jobs: + pytest-collect: + name: "Pytest: check test collection" + runs-on: ubuntu-latest + steps: + - name: Clone repo + uses: actions/checkout@v2 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install pytest + python -m pip install .[dev] + - name: "pytest: check test collection" + run: pytest --collect-only From 12a9685acdc6a5543c7fd3842141c9e68fc1c666 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Mon, 22 Jan 2024 16:08:59 +0100 Subject: [PATCH 3/4] fixup! Issue #16/#23 use separate workflow for pytest-collect --- .github/workflows/lint.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 06ec832..8462b37 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -21,11 +21,10 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - python -m pip install isort black ruff pytest + python -m pip install isort black ruff - name: isort run: python -m isort . --check --diff # - name: black # run: python -m black --check --diff . - name: ruff run: ruff check . - \ No newline at end of file From b57c4078d9605f6e596c231ed58cab3e237eeb71 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Mon, 22 Jan 2024 16:10:13 +0100 Subject: [PATCH 4/4] fixup! fixup! Issue #16/#23 use separate workflow for pytest-collect --- .github/workflows/pytest-collect.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest-collect.yaml b/.github/workflows/pytest-collect.yaml index 0cbd907..83ca216 100644 --- a/.github/workflows/pytest-collect.yaml +++ b/.github/workflows/pytest-collect.yaml @@ -1,10 +1,10 @@ name: Pytest-collect on: + push: + branches: [ main ] pull_request: branches: [ main ] - paths: - - 'tests/**' jobs: pytest-collect: