@@ -20,18 +20,16 @@ jobs:
2020 matrix : ${{ steps.set-matrix.outputs.matrix }}
2121 steps :
2222 - uses : actions/checkout@v4
23- with :
24- persist-credentials : false
2523
26- - uses : westerveltco/setup-ci-action@v0
24+ - name : Install uv
25+ uses : astral-sh/setup-uv@v5
2726 with :
28- python-version : 3.9
29- extra-python-dependencies : nox
30- use-uv : true
27+ enable-cache : true
28+ pyproject-file : pyproject.toml
3129
3230 - id : set-matrix
3331 run : |
34- echo "matrix=$(python -m nox -l --json | jq -c '[.[] | select(.name == "tests") | {"python-version": .python, "django-version": .call_spec.django}] | {include: .}')" >> $GITHUB_OUTPUT
32+ uv run nox --session "gha_matrix"
3533
3634 test :
3735 name : Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
@@ -42,18 +40,16 @@ jobs:
4240 matrix : ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
4341 steps :
4442 - uses : actions/checkout@v4
45- with :
46- persist-credentials : false
4743
48- - uses : westerveltco/setup-ci-action@v0
44+ - name : Install uv
45+ uses : astral-sh/setup-uv@v5
4946 with :
50- python-version : ${{ matrix.python-version }}
51- extra-python-dependencies : nox
52- use-uv : true
47+ enable-cache : true
48+ pyproject-file : pyproject.toml
5349
5450 - name : Run tests
5551 run : |
56- python -m nox --session "tests(python='${{ matrix.python-version }}', django='${{ matrix.django-version }}')"
52+ uv run nox --session "tests(python='${{ matrix.python-version }}', django='${{ matrix.django-version }}')"
5753
5854 tests :
5955 runs-on : ubuntu-latest
@@ -71,32 +67,51 @@ jobs:
7167 runs-on : ubuntu-latest
7268 steps :
7369 - uses : actions/checkout@v4
74- with :
75- persist-credentials : false
7670
77- - uses : westerveltco/setup-ci-action@v0
71+ - name : Install uv
72+ uses : astral-sh/setup-uv@v5
7873 with :
79- python-version : 3.9
80- extra-python-dependencies : nox
81- use-uv : true
74+ enable-cache : true
75+ pyproject-file : pyproject.toml
8276
83- - name : Run mypy
77+ - name : Run type checks
8478 run : |
85- python -m nox --session "mypy"
79+ uv run nox --session "mypy"
8680
8781 coverage :
8882 runs-on : ubuntu-latest
8983 steps :
9084 - uses : actions/checkout@v4
91- with :
92- persist-credentials : false
9385
94- - uses : westerveltco/setup-ci-action@v0
86+ - name : Install uv
87+ uses : astral-sh/setup-uv@v5
9588 with :
96- python-version : 3.9
97- extra-python-dependencies : nox
98- use-uv : true
89+ enable-cache : true
90+ pyproject-file : pyproject.toml
91+
92+ - name : Generate code coverage
93+ run : |
94+ uv run nox --session "coverage"
9995
100- - name : Run coverage
96+ docker :
97+ runs-on : ubuntu-latest
98+ steps :
99+ - uses : actions/checkout@v4
100+
101+ - name : Set up Docker Buildx
102+ uses : docker/setup-buildx-action@v3
103+
104+ - name : Build Docker image
105+ uses : docker/build-push-action@v6
106+ with :
107+ context : .
108+ file : .dockerfiles/Dockerfile
109+ load : true
110+ tags : django-email-relay-test:latest
111+ push : false
112+ cache-from : type=gha
113+ cache-to : type=gha,mode=max
114+
115+ - name : Run container and check
101116 run : |
102- python -m nox --session "coverage"
117+ docker run --rm --name test-container django-email-relay-test:latest uv run -m email_relay.service --help
0 commit comments