Skip to content

Commit 68cfe77

Browse files
authored
Release 1.1.0
Release 1.1.0
2 parents ebacc39 + 849bb24 commit 68cfe77

108 files changed

Lines changed: 15529 additions & 1701 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ jobs:
1414
- uses: astral-sh/ruff-action@v1
1515
with:
1616
changed-files: "true"
17+
args: "check --config pyproject.toml"
18+
# - uses: astral-sh/ruff-action@v1
19+
# with:
20+
# changed-files: "true"
21+
# args: "format --check --config pyproject.toml"

.github/workflows/tests.yaml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- DEV
8+
push:
9+
branches:
10+
- main
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pull-requests: write # required to post PR comments
16+
17+
jobs:
18+
# ------------------------------------------------------------------
19+
# Unit tests (fast, no Klipper dependency)
20+
# ------------------------------------------------------------------
21+
unit-test:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0 # full history required for gh-pages deployment
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.12"
33+
cache: "pip"
34+
cache-dependency-path: requirements.txt
35+
36+
- name: Create virtual environment
37+
run: python -m venv .venv
38+
39+
- name: Install dependencies
40+
run: .venv/bin/pip install -r requirements.txt
41+
42+
- name: Run unit tests with coverage
43+
run: |
44+
.venv/bin/python -m pytest tests/ \
45+
--cov=extras \
46+
--cov-report=term-missing \
47+
--cov-report=html:coverage-report \
48+
--cov-report=xml:coverage.xml \
49+
--junitxml=test-results.xml
50+
51+
- name: Write coverage summary to job log
52+
if: always()
53+
run: |
54+
echo "## Coverage Summary" >> $GITHUB_STEP_SUMMARY
55+
echo '```' >> $GITHUB_STEP_SUMMARY
56+
.venv/bin/python -m coverage report >> $GITHUB_STEP_SUMMARY
57+
echo '```' >> $GITHUB_STEP_SUMMARY
58+
59+
- name: Upload HTML coverage report as artifact
60+
if: always()
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: coverage-report.zip
64+
path: coverage-report/
65+
if-no-files-found: error
66+
retention-days: 30
67+
68+
# ------------------------------------------------------------------
69+
# Klippy integration tests (runs AFC under a real Klipper/Kalico process)
70+
# ------------------------------------------------------------------
71+
klippy-test:
72+
runs-on: ubuntu-latest
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
firmware:
77+
- name: klipper
78+
repo: https://github.com/Klipper3d/klipper.git
79+
- name: kalico
80+
repo: https://github.com/KalicoCrew/kalico.git
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- name: Set up Python
86+
uses: actions/setup-python@v5
87+
with:
88+
python-version: "3.12"
89+
cache: "pip"
90+
cache-dependency-path: requirements.txt
91+
92+
- name: Create virtual environment
93+
run: python -m venv .venv
94+
95+
- name: Install Python test dependencies
96+
run: .venv/bin/pip install -r requirements.txt
97+
98+
# Clone into klipper/ regardless of variant so KLIPPER_PATH needs no change.
99+
- name: Clone ${{ matrix.firmware.name }}
100+
run: git clone --depth 1 ${{ matrix.firmware.repo }} klipper
101+
102+
- name: Install klippy Python dependencies
103+
run: .venv/bin/pip install -r klipper/scripts/klippy-requirements.txt
104+
105+
# chelper is a C extension compiled at runtime. Kalico does not ship
106+
# build_chelper.py, so the fallback chain handles both variants.
107+
- name: Build chelper
108+
run: |
109+
cd klipper
110+
python klippy/chelper/__init__.py 2>/dev/null || \
111+
make PYTHON=$(pwd)/../.venv/bin/python scripts/build_chelper.py || \
112+
true # chelper may auto-build on first import; continue
113+
114+
# Install the ARM cross-compiler toolchain needed to build STM32H723 firmware.
115+
- name: Install ARM cross-compiler
116+
run: sudo apt-get install -y gcc-arm-none-eabi libnewlib-arm-none-eabi
117+
118+
# Build the STM32H723 MCU dict.
119+
# The dict file is generated during compilation (before linking), so we
120+
# allow link errors (|| true) and verify the dict was produced.
121+
- name: Build STM32H723 firmware dict
122+
run: |
123+
cp tests/klippy/stm32h723.config klipper/.config
124+
make -C klipper olddefconfig
125+
make -C klipper || true # link may fail with newer GCC LTO; dict is generated earlier
126+
test -f klipper/out/klipper.dict || (echo "ERROR: klipper.dict not generated" && exit 1)
127+
mkdir -p tests/dict
128+
cp klipper/out/klipper.dict tests/dict/stm32h723.dict
129+
130+
- name: Run klippy integration tests
131+
env:
132+
KLIPPER_PATH: ${{ github.workspace }}/klipper
133+
DICTDIR: ${{ github.workspace }}/tests/dict
134+
run: |
135+
.venv/bin/python -m pytest tests/klippy/ -v \
136+
--junitxml=klippy-test-results-${{ matrix.firmware.name }}.xml
137+
138+
- name: Upload klippy test results
139+
if: always()
140+
uses: actions/upload-artifact@v4
141+
with:
142+
name: klippy-test-results-${{ matrix.firmware.name }}.zip
143+
path: klippy-test-results-${{ matrix.firmware.name }}.xml
144+
if-no-files-found: warn
145+
retention-days: 30

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ pip-delete-this-directory.txt
3939

4040
# Unit test / coverage reports
4141
htmlcov/
42+
coverage-report/
43+
test-results.xml
4244
.tox/
4345
.nox/
4446
.coverage
@@ -129,8 +131,16 @@ dmypy.json
129131
.pyre/
130132

131133
klipper/
134+
kalico/
132135

133136
uv.lock
134137

138+
# Klippy integration test artifacts (generated in CI, not committed)
139+
tests/dict/*.dict
140+
tests/logs/
141+
klippy-test-results*.xml
142+
135143
.idea/
136-
site/
144+
site/
145+
146+
.claude/

0 commit comments

Comments
 (0)