-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (43 loc) · 1.62 KB
/
Copy pathci.yml
File metadata and controls
53 lines (43 loc) · 1.62 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
name: CI
on: [ push, pull_request ]
jobs:
test:
name: Tests
runs-on: ubuntu-latest
# Code based on https://docs.astral.sh/uv/guides/integration/github/
steps:
- name: Check out Git repository
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Install System Dependencies
# Retries installing files 3 times, as either the GitHub Actions runner or APT's API can be unreliable
run: |
sudo apt update
sudo apt install python3-dev libldap2-dev libsasl2-dev libssl-dev -o Acquire::Retries=3
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set `UV_PROJECT_ENVIRONMENT` envvar
# Install packages into the system environment instead of a `.venv/`.
# (`pythonLocation` is from `actions/setup-python` - see
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#environment-variables)
run: echo "UV_PROJECT_ENVIRONMENT=$pythonLocation" >> $GITHUB_ENV
- name: Install Python dependencies
run: uv sync --locked --group ci
- name: Create `.env`
shell: bash
run: cp .env.example .env
- name: Run Django Tests
run: |
uv run manage.py collectstatic --no-input
uv run coverage run manage.py test
uv run coverage xml
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml