Repository navigation
97 lines (82 loc) · 2.95 KB
/
Copy pathci.yaml
File metadata and controls
97 lines (82 loc) · 2.95 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
85
86
87
88
89
90
91
92
93
94
95
96
97
# CI - Lint, test, and build
#
# Runs on PRs and pushes to main/release branches.
# Covers the Python package (uv/ruff/pytest) and the Java keycloak-spi module.
#
name: CI
on:
pull_request:
branches:
- main
- "release-*"
push:
branches:
- main
permissions:
contents: read
jobs:
lint:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
# AIAC requires Python >= 3.12 (see pyproject.toml). rossoctl/rossoctl
# lints on 3.11 + 3.12; here 3.11 is below the floor, so 3.12 only.
python-version: ["3.12"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Lint with ruff
run: |
# Rule selection is in pyproject.toml [tool.ruff.lint]
uvx ruff@0.14.8 check .
uvx ruff@0.14.8 format --check .
- name: Run pre-commit hooks
env:
SKIP: ai-assisted-by-trailer
run: uvx pre-commit@4.6.0 run --all-files --show-diff-on-failure
python-tests:
name: Python Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Install dependencies
# This project has no build-system (src-layout wired via
# pyproject [tool.pytest.ini_options].pythonpath), so export the
# locked deps without the project itself and install those.
run: |
uv export --frozen --no-emit-project --all-extras --format requirements-txt > /tmp/requirements.txt
uv venv
uv pip install -r /tmp/requirements.txt
- name: Run tests
# pyproject addopts already deselect the live markers
# (integration / system / llm / eval), so this is the offline unit suite.
# Marker-only selection — no path arg; testpaths covers both trees.
run: uv run --no-project pytest
keycloak-spi:
name: Keycloak SPI (Java)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Java
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: temurin
java-version: '17'
cache: maven
- name: Test
run: mvn -B -f keycloak-spi/pom.xml test