-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (66 loc) · 1.93 KB
/
Copy pathpython-checks.yml
File metadata and controls
76 lines (66 loc) · 1.93 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Python Checks
permissions:
contents: read
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run unit tests
run: |
python -m unittest discover
- name: Report test results
if: always()
run: |
echo "### 🧪 Test Results" >> $GITHUB_STEP_SUMMARY
if [ ${{ job.status }} == "success" ]; then
echo "✅ All tests passed successfully!" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Some tests failed. Please check the logs for details." >> $GITHUB_STEP_SUMMARY
fi
format:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run unit tests
run: |
ruff format --check --diff .
- name: Report test results
if: always()
run: |
echo "### 🧪 Test Results" >> $GITHUB_STEP_SUMMARY
if [ ${{ job.status }} == "success" ]; then
echo "✅ All formatting checks passed successfully!" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Some formatting checks failed. Please check the logs for details." >> $GITHUB_STEP_SUMMARY
fi