Skip to content

Commit d6f0128

Browse files
committed
2 parents 35377f2 + 6ef8f0f commit d6f0128

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

.github/workflows/server.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,55 @@
1-
name: Server testing
2-
31
on:
42
push:
53
branches: [ main ]
4+
branches: [ '*' ] # Runs on any branch
65
pull_request:
76
branches: [ main ]
7+
branches: [ '*' ]
88

99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
12+
1313
steps:
1414
- uses: actions/checkout@v3
1515
- name: Set up python
16+
- name: Set up Python
1617
uses: actions/setup-python@v3
1718
with:
1819
python-version: '3.9'
20+
python-version: '3.11'
1921

2022
- name: Install dependencies
2123
run: |
2224
python -m pip install --upgrade pip
23-
pip install -r requirements.txt
25+
pip install -r server/requirements.txt
2426
# - name: Run tests
2527
# run: |
2628
# python manage.py test
27-
29+
2830
- name: Check for errors
31+
if [ -f server/requirements.txt ]; then
32+
python -m pip install --upgrade pip
33+
pip install -r server/requirements.txt
34+
else
35+
echo "requirements.txt not found. Skipping dependency installation."
36+
fi
37+
- name: Run Django tests
38+
run: |
39+
if [ -f manage.py ]; then
40+
python manage.py test
41+
else
42+
echo "manage.py not found. Skipping tests."
43+
fi
44+
- name: Run Django checks for errors
45+
run: |
46+
if [ -f manage.py ]; then
47+
python manage.py check
48+
else
49+
echo "manage.py not found. Skipping Django checks."
50+
fi
51+
- name: Lint code
2952
run: |
30-
python manage.py check
53+
python manage.py check
54+
pip install flake8
55+
flake8 .

0 commit comments

Comments
 (0)