From dfec22ab9bf29057dadd86ddd00ac8b7887a9eb2 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Thu, 3 Oct 2024 20:46:28 +0200 Subject: [PATCH] feat: run pytest for PRs --- .github/workflows/pytest.yml | 28 ++++++++++++++++++++++++++++ requirements.txt | 1 + 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..c309bc5 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,28 @@ +name: Run Pytest on Pull Request + +on: + pull_request: + branches: + - main # Change this to your default branch if it's not 'main' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run Pytest + run: | + python -m pytest -v tests/ diff --git a/requirements.txt b/requirements.txt index a024680..bb549d8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ scikit-learn==1.5.2 deap==1.4.1 joblib==1.4.2 requests==2.32.3 +pytest==8.3.3