-
-
Notifications
You must be signed in to change notification settings - Fork 65
56 lines (47 loc) · 1.37 KB
/
api_pipeline.yml
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
name: API Pipeline
on:
pull_request:
branches:
- 'main'
- 'develop'
paths:
- 'api/**.py'
- 'api/requirements*.*'
- 'docker/dockerfiles/Dockerfile.backend*'
- 'docker-compose.yml'
- '.github/workflows/api_pipeline.yml'
jobs:
static_analysis:
name: Run black formatting check
runs-on: ubuntu-22.04
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Black with latest pip
run: |
python -m pip install --upgrade pip
cat ./api/requirements-dev.txt | grep black== | cut -d' ' -f1 | xargs pip install
- name: Check formatting with black
run: |
black --line-length 120 --target-version py311 --exclude migrations --check ./api
tests:
name: Run api tests
runs-on: ubuntu-22.04
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./api/requirements-dev.txt
- name: Run tests
run: |
ENVIRONMENT=test DJANGO_SETTINGS_MODULE=seismic_site.settings.test ./api/manage.py test