Repository navigation
99 lines (92 loc) · 3.38 KB
/
Copy pathpython-package.yml
File metadata and controls
99 lines (92 loc) · 3.38 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
98
99
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python checks
on:
push:
branches: [ "main", "release/**" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
env:
# Must match the exclude-newer span recorded in uv.lock, or `uv sync --locked` fails.
UV_EXCLUDE_NEWER: "7 days"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@b1de5da23ed0a6d14e0aeee8ed52fdd87af2363c # v2
- name: Install uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: true
cache-suffix: "python${{ matrix.python-version }}"
- name: Install the project
run: uv sync --locked --all-extras --dev
#----------------------------------------------
# run ruff
#----------------------------------------------
- name: Linter with ruff
if: matrix.python-version == 3.15
run: |
uv run ruff check .
uv run ruff format --check .
#----------------------------------------------
# run pytest
#----------------------------------------------
- name: Test with pytest
run: |
uv run pytest -n auto --cov --cov-report=xml:coverage.xml
uv run coverage xml
#----------------------------------------------
# upload coverage
#----------------------------------------------
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7
if: matrix.python-version == 3.15
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
directory: .
env_vars: OS,PYTHON
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
verbose: true
pssm-drift:
# The XMI may not be stored or cached anywhere, see tests/uml/pssm/README.md.
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.15"
- name: Install uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: true
cache-suffix: "pssm-drift"
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Download the PSSM test suite XMI
run: |
xmi_dir="$(mktemp -d)"
curl --proto "=https" --fail --silent --show-error --location --retry 3 \
--output "$xmi_dir/PSSM_TestSuite.xmi" \
https://www.omg.org/spec/PSSM/20181101/PSSM_TestSuite.xmi
echo "PSSM_XMI=$xmi_dir/PSSM_TestSuite.xmi" >> "$GITHUB_ENV"
- name: Compare the committed cases with the converter output
env:
PSSM_REQUIRED: "1"
run: uv run --locked pytest tests/uml/pssm/test_pssm_drift.py --timeout 300