Skip to content

Commit 44d3b3a

Browse files
committed
test new unit test for pr-requests
1 parent bd998d3 commit 44d3b3a

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/pr-tests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: PR Unit Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- master # Add any other branches where you want to enforce tests
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.12" # Change this to match your setup
21+
22+
- name: Install Dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
poetry install
26+
pip install pytest
27+
28+
- name: Run Unit Tests
29+
run: pytest tests/
30+
31+
- name: Verify Tests Passed
32+
if: ${{ success() }}
33+
run: echo "All tests passed! Pull request is allowed."
34+
35+
- name: Fail PR on Test Failure
36+
if: ${{ failure() }}
37+
run: exit 1 # This ensures the PR cannot be merged if tests fail

0 commit comments

Comments
 (0)