|
6 | 6 | - main |
7 | 7 | - dev |
8 | 8 | - demo |
| 9 | + - psl-backend-unittest |
9 | 10 | pull_request: |
10 | 11 | types: |
11 | 12 | - opened |
|
18 | 19 | - demo |
19 | 20 |
|
20 | 21 | jobs: |
21 | | -# frontend_tests: |
22 | | -# runs-on: ubuntu-latest |
23 | | - |
24 | | -# steps: |
25 | | -# - name: Checkout code |
26 | | -# uses: actions/checkout@v3 |
27 | | - |
28 | | -# - name: Set up Node.js |
29 | | -# uses: actions/setup-node@v3 |
30 | | -# with: |
31 | | -# node-version: '20' |
32 | | - |
33 | | -# - name: Check if Frontend Test Files Exist |
34 | | -# id: check_frontend_tests |
35 | | -# run: | |
36 | | -# if [ -z "$(find App/frontend/src -type f -name '*.test.js' -o -name '*.test.ts' -o -name '*.test.tsx')" ]; then |
37 | | -# echo "No frontend test files found, skipping frontend tests." |
38 | | -# echo "skip_frontend_tests=true" >> $GITHUB_ENV |
39 | | -# else |
40 | | -# echo "Frontend test files found, running tests." |
41 | | -# echo "skip_frontend_tests=false" >> $GITHUB_ENV |
42 | | -# fi |
43 | | - |
44 | | -# - name: Install Frontend Dependencies |
45 | | -# if: env.skip_frontend_tests == 'false' |
46 | | -# run: | |
47 | | -# cd App/frontend |
48 | | -# npm install |
49 | | - |
50 | | -# - name: Run Frontend Tests with Coverage |
51 | | -# if: env.skip_frontend_tests == 'false' |
52 | | -# run: | |
53 | | -# cd App/frontend |
54 | | -# npm run test -- --coverage |
55 | | - |
56 | | -# - name: Skip Frontend Tests |
57 | | -# if: env.skip_frontend_tests == 'true' |
58 | | -# run: | |
59 | | -# echo "Skipping frontend tests because no test files were found." |
| 22 | + # frontend_tests: |
| 23 | + # runs-on: ubuntu-latest |
| 24 | + |
| 25 | + # steps: |
| 26 | + # - name: Checkout code |
| 27 | + # uses: actions/checkout@v3 |
| 28 | + |
| 29 | + # - name: Set up Node.js |
| 30 | + # uses: actions/setup-node@v3 |
| 31 | + # with: |
| 32 | + # node-version: '20' |
| 33 | + |
| 34 | + # - name: Check if Frontend Test Files Exist |
| 35 | + # id: check_frontend_tests |
| 36 | + # run: | |
| 37 | + # if [ -z "$(find App/frontend/src -type f -name '*.test.js' -o -name '*.test.ts' -o -name '*.test.tsx')" ]; then |
| 38 | + # echo "No frontend test files found, skipping frontend tests." |
| 39 | + # echo "skip_frontend_tests=true" >> $GITHUB_ENV |
| 40 | + # else |
| 41 | + # echo "Frontend test files found, running tests." |
| 42 | + # echo "skip_frontend_tests=false" >> $GITHUB_ENV |
| 43 | + # fi |
| 44 | + |
| 45 | + # - name: Install Frontend Dependencies |
| 46 | + # if: env.skip_frontend_tests == 'false' |
| 47 | + # run: | |
| 48 | + # cd App/frontend |
| 49 | + # npm install |
| 50 | + |
| 51 | + # - name: Run Frontend Tests with Coverage |
| 52 | + # if: env.skip_frontend_tests == 'false' |
| 53 | + # run: | |
| 54 | + # cd App/frontend |
| 55 | + # npm run test -- --coverage |
| 56 | + |
| 57 | + # - name: Skip Frontend Tests |
| 58 | + # if: env.skip_frontend_tests == 'true' |
| 59 | + # run: | |
| 60 | + # echo "Skipping frontend tests because no test files were found." |
60 | 61 |
|
61 | 62 | backend_tests: |
62 | 63 | runs-on: ubuntu-latest |
63 | | - |
64 | 64 |
|
65 | 65 | steps: |
66 | 66 | - name: Checkout code |
|
69 | 69 | - name: Set up Python |
70 | 70 | uses: actions/setup-python@v4 |
71 | 71 | with: |
72 | | - python-version: '3.11' |
| 72 | + python-version: "3.11" |
73 | 73 |
|
74 | 74 | - name: Install Backend Dependencies |
75 | 75 | run: | |
|
81 | 81 | - name: Check if Backend Test Files Exist |
82 | 82 | id: check_backend_tests |
83 | 83 | run: | |
84 | | - if [ -z "$(find src/api -type f -name 'test_*.py')" ]; then |
| 84 | + if [ -z "$(find src/tests/api -type f -name 'test_*.py')" ]; then |
85 | 85 | echo "No backend test files found, skipping backend tests." |
86 | 86 | echo "skip_backend_tests=true" >> $GITHUB_ENV |
87 | 87 | else |
|
94 | 94 | run: | |
95 | 95 | pytest --cov=. --cov-report=term-missing --cov-report=xml |
96 | 96 |
|
97 | | -
|
98 | | -
|
99 | 97 | - name: Skip Backend Tests |
100 | 98 | if: env.skip_backend_tests == 'true' |
101 | 99 | run: | |
|
0 commit comments