-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.63 KB
/
ci.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
57
58
59
60
61
62
63
name: CI
on:
pull_request:
branches: ['main', 'dev']
paths-ignore: ['docs/**']
push:
branches: ['main', 'dev']
paths-ignore: ['docs/**']
# Concurrency control: Only one workflow run per PR branch.
# In-progress runs for a PR branch are canceled on new pushes.
# For non-PR events, each run is treated independently.
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# The linter job runs the same quality checks run by pre-commit
# when making a commit. It should pass as long as everyone
# is using pre-commit correctly before pushing.
linter:
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
# Consider using pre-commit.ci for open source project
- name: Run pre-commit
uses: pre-commit/[email protected]
# run-tests does a basic Django check and runs all the tests
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
cache-dependency-path: |
requirements/base.txt
requirements/local.txt
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/local.txt
- name: Check Django setup
run: python3 manage.py check
- name: Test with pytest
run: pytest