-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 1.98 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
64
65
66
67
name: test
on:
push:
branches: [main]
paths-ignore: [ "docs/**", "README.md", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "SECURITY.md", "Justfile"]
pull_request:
branches: [main]
paths-ignore: [ "docs/**", "README.md", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "SECURITY.md", "Justfile"]
concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
DJANGO_DEBUG: "1"
jobs:
run:
name: Python ${{ matrix.python-version }} ${{ matrix.django-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11", "3.12"]
django-version: ["5.0", "5.1"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Setup cache
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version}}-${{ hashFiles('uv.lock') }}
restore-keys: venv-${{ runner.os }}-${{ matrix.python-version}}-
- name: Create venv, install dependencies
run: |
uv sync
source .venv/bin/activate
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: Run tests
run: |
uv run --no-sync --with Django~="${{ matrix.django-version }}.0" -m pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/django_markov
uv run --no-sync --with Django~="${{ matrix.django-version }}.0" -m coverage lcov
- name: Submit coverage data to coveralls.io
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "coverage.lcov"