Repository navigation
84 lines (76 loc) · 2.8 KB
/
Copy pathci.yml
File metadata and controls
84 lines (76 loc) · 2.8 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
75
76
77
78
79
80
81
82
83
84
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
name: Test (Python ${{ matrix.python }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.3.2
with:
enable-cache: true
- run: uv python install ${{ matrix.python }}
- run: uv sync --all-packages --python ${{ matrix.python }}
- run: uv run --python ${{ matrix.python }} pytest -q
lint:
name: Lint and type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.3.2
with:
enable-cache: true
- run: uv sync --all-packages
- run: uv run ruff check .
- run: uv run ruff format --check .
- run: uv run mypy easyssf-core/src easyssf-receiver/src easyssf-test/src easyssf-receiver-fastapi/src conformance/src examples/fastapi/resource-server/src
build:
name: Build the distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.3.2
- run: uv build --all-packages
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
install:
name: Install the wheels in a clean environment
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v7
with:
name: dist
path: dist
- uses: astral-sh/setup-uv@v10.3.2
# no checkout and no workspace: the published distributions have to resolve each other and
# their dependencies from the index and the wheels alone
- run: uv venv --python 3.11 clean
- run: uv pip install --python clean --find-links dist --no-build "easyssf-receiver-fastapi==0.7.0" "easyssf-test==0.7.0"
- run: uv pip list --python clean | grep easyssf
- run: |
clean/bin/python - <<'EOF'
from fastapi import FastAPI
from easyssf.fastapi import push_router_for, receiver_lifespan
from easyssf.receiver import Receiver, ReceiverConfig, for_event
from easyssf.testing import TestTransmitter
transmitter = TestTransmitter()
config = ReceiverConfig.from_mapping(
{"transmitter-issuer": transmitter.issuer, "expected-audience": "https://app.example", "push": {"expected-auth-header": "Bearer x"}}
)
receiver = Receiver(config, handlers=[for_event("CaepSessionRevoked", lambda event: None)], http_client=transmitter.client)
app = FastAPI(lifespan=receiver_lifespan(receiver))
app.include_router(push_router_for(receiver))
print("imported and assembled from the wheels:", receiver)
EOF