-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 2.22 KB
/
Copy pathci.yml
File metadata and controls
74 lines (63 loc) · 2.22 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: CI
on:
push:
pull_request:
env:
SUFFOLK_EFILE_API_KEY: ${{ secrets.EFILE_PROXY_API_KEY }}
TESTS_TYLER_USERNAME: ${{ secrets.TYLER_EMAIL }}
TESTS_TYLER_PASSWORD: ${{ secrets.TYLER_PASSWORD }}
jobs:
checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check: [ruff, type, tests]
name: "${{ matrix.check }}"
steps:
# Common setup
- name: Checkout
uses: actions/checkout@v7
# NOTE: we manage uv and python directly right now, but we can DRY this up by using docker within the
# GH actions workflow in the future. The direct method is supposed to be faster so we'll leave it for
# now. When we start to have more complex dependencies within the dockerfile we can swap over.
# Sample run commands:
# docker build -t form-submission-mvp:ci .
# docker run --rm form-submission-mvp:ci uv run pytest -q
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Add uv to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Ensure Python 3.12 and sync deps (dev)
working-directory: efile_app
run: |
uv python install 3.12
uv sync --group dev
# No per-check installs needed; everything is managed by uv
# ruff
- name: Formatting (check only)
if: matrix.check == 'ruff'
working-directory: efile_app
run: |
uv run ruff format --check .
uv run djlint --check .
git ls-files '*.css' | xargs -n 1 --verbose bash -c 'diff -ru "$0" <(uv run css-beautify "$0")'
git ls-files '*.js' | xargs -n 1 --verbose bash -c 'diff -ru "$0" <(uv run js-beautify "$0")'
- name: Ruff lint
if: matrix.check == 'ruff'
working-directory: efile_app
run: |
uv run ruff check .
uv run djlint .
# type checking
- name: Type check (ty)
if: matrix.check == 'type'
working-directory: efile_app
run: uv run ty check
# tests
- name: Run tests
if: matrix.check == 'tests'
env:
DJANGO_SETTINGS_MODULE: efile.settings
working-directory: efile_app
run: uv run pytest -q