Skip to content

Commit 86a046f

Browse files
committed
feat: move testing from py-app to pytest.yml
This also updates pytest.yml to comply with the same 'specification' as python-app.yml
1 parent bcffa17 commit 86a046f

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

.github/workflows/pytest.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,28 @@ on:
88
branches: ['main']
99
push:
1010
branches: ['main']
11+
release:
12+
types: [prereleased, published]
1113
workflow_dispatch:
1214

1315
jobs:
1416
tests:
1517
runs-on: ubuntu-latest
1618

1719
steps:
18-
- name: checkout
19-
uses: actions/checkout@v4
20+
- uses: actions/checkout@v4
2021

21-
- name: setup-python
22+
- name: Set up Python 3.12
2223
uses: actions/setup-python@v3
2324
with:
24-
python-version: '3.12'
25-
- run: pip install -r requirements.txt
26-
- run: pip install pytest
25+
python-version: "3.12"
2726

28-
# - shell: bash
29-
# env:
30-
# TEST_SECRET: ${{ secrets.TEST_SECRET }}
31-
# run: |
32-
# pytest
33-
- run: pytest
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
pip install pytest
32+
33+
- name: Test with pytest
34+
run: |
35+
pytest tests/

.github/workflows/python-app.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
1+
# This workflow will install Python dependencies and lint with a single version of Python
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
33

44
# This workflow will upload a Python Package using Twine when a release is created
@@ -37,17 +37,14 @@ jobs:
3737
- name: Install dependencies
3838
run: |
3939
python -m pip install --upgrade pip
40-
pip install flake8 pytest
40+
pip install flake8
4141
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
4242
- name: Lint with flake8
4343
run: |
4444
# stop the build if there are Python syntax errors or undefined names
4545
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4646
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
4747
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
48-
- name: Test with pytest
49-
run: |
50-
pytest tests/
5148
- run: pip install -U wheel build
5249
- name: Build a binary wheel and a source tarball
5350
run: python -m build

0 commit comments

Comments
 (0)