Repository navigation
51 lines (48 loc) · 1.68 KB
/
Copy pathci.yml
File metadata and controls
51 lines (48 loc) · 1.68 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
name: CI
on:
push:
branches: [main]
paths-ignore: ["docs/**", "**.md", "LICENSE"]
pull_request:
paths-ignore: ["docs/**", "**.md", "LICENSE"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: config.settings
DJANGO_SECRET_KEY: ci-secret-key
DJANGO_DEBUG: "false"
DJANGO_ALLOWED_HOSTS: "*"
SIMPLEAUDIT_LOCAL_SQLITE: "1"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # the embedded-Hatchet step diffs against origin/main
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv sync --frozen --extra dev
- name: Lint (ruff)
run: uv run ruff check .
- name: Cache testmon dependency data
uses: actions/cache@v4
with:
path: .testmondata
key: testmon-${{ github.sha }}
restore-keys: |
testmon-
- name: Run tests (parallel, affected-only via testmon)
run: uv run pytest --testmon -n auto -m "not embedded_hatchet"
- name: Check if embedded Hatchet files changed
id: hatchet-changed
run: |
CHANGED=$(git diff --name-only origin/main...HEAD -- infra/minimal_config.py infra/worker.py 2>/dev/null || true)
if [ -n "$CHANGED"]; then echo "changed=true" >> "$GITHUB_OUTPUT"; else echo "changed=false" >> "$GITHUB_OUTPUT"; fi
- name: Run tests (embedded Hatchet, serial)
if: steps.hatchet-changed.outputs.changed == 'true'
run: uv run pytest -m "embedded_hatchet"