forked from openlibhums/janeway
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.36 KB
/
ci.yml
File metadata and controls
54 lines (45 loc) · 1.36 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
on:
push:
branches:
- master
- main
- r-v**
pull_request:
branches:
- master
- main
- r-v**
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout the codebase
uses: actions/checkout@v4
- name: Set up python environments
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Set up environment variables
run: |
echo "DB_VENDOR=sqlite" >> "$GITHUB_ENV"
echo "DB_NAME=:memory:" >> "$GITHUB_ENV"
echo "JANEWAY_SETTINGS_MODULE=core.janeway_global_settings" >> "$GITHUB_ENV"
- name: Install all dependencies
run: |
python -m pip install --upgrade pip
pip install --src lib/ -r requirements.txt -r dev-requirements.txt
- name: Check code formatting with Ruff
run: |
echo "Running formatting check..."
ruff format --check .
echo "Formatting check completed."
- name: Check presence of unmigrated model changes
run: |
echo "Running migration checks..."
python src/manage.py makemigrations --check
echo "Migration checks completed."
- name: Run Django unit tests
run: |
echo "Running unit tests"
python src/manage.py test
echo "Test run completed."