-
Notifications
You must be signed in to change notification settings - Fork 56
53 lines (46 loc) · 1.23 KB
/
pr-tests.yml
File metadata and controls
53 lines (46 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Run tests on PR
permissions:
contents: read
on:
pull_request:
branches:
- main
- development
- hotfix
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
test:
if: github.event.pull_request.draft == false
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python version
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[all]"
pip install ".[dev]"
- name: Run all Feluda Unit Tests
run: |
echo "Running all Feluda Unit Tests folder..."
for test_file in $(find tests/feluda_unit_tests -type f -name "test_*.py"); do
echo "############# Running file: $test_file #############"
python -m unittest $test_file
if [ $? -ne 0 ]; then
echo "Tests in $test_file failed"
exit 1
fi
echo "Run Successful"
done