-
-
Notifications
You must be signed in to change notification settings - Fork 123
62 lines (51 loc) · 2.39 KB
/
ci-build_test.yaml
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
name: Build test
on:
workflow_dispatch:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
dependencies:
- 'pyproject.toml'
- 'scripts/klippy-requirements.txt'
- 'scripts/requirements_dev.txt'
klipper:
- 'pyproject.toml'
- 'Makefile'
- 'src/**'
- 'lib/**'
- 'test/configs/**'
- 'scripts/Dockerfile-build'
- 'scripts/buildcommands.py'
- 'scripts/check-gcc.sh'
# Always pull the latest image to take advantage of layer caching
- name: Pull docker image
run: docker pull dangerklippers/klipper-build:latest
- name: Test Klipper build (changes to the firmware)
if: steps.changes.outputs.klipper == 'true'
run: docker build -f scripts/Dockerfile-build -t dangerklippers/klipper-build:latest .
- name: Ensure scripts/klippy-dependencies.txt is up to date
if: steps.changes.outputs.dependencies == 'true'
uses: nickcharlton/diff-check@main
with:
command: |
docker run -v $PWD:/klipper dangerklippers/klipper-build:latest uv export --frozen -o scripts/klippy-requirements.txt --no-dev --no-hashes
docker run -v $PWD:/klipper dangerklippers/klipper-build:latest uv export --frozen -o scripts/requirements_dev.txt --only-dev --no-hashes
# This *could* be done with a matrix, but then we would have to figure out sharing the docker image between builds
- name: Test Klippy (Python 3.9)
run: docker run -v $PWD:/klipper dangerklippers/klipper-build:latest --python 3.9 py.test -n auto
- name: Test Klippy (Python 3.10)
run: docker run -v $PWD:/klipper dangerklippers/klipper-build:latest --python 3.10 py.test -n auto
- name: Test Klippy (Python 3.11)
run: docker run -v $PWD:/klipper dangerklippers/klipper-build:latest --python 3.11 py.test -n auto
- name: Test Klippy (Python 3.12)
run: docker run -v $PWD:/klipper dangerklippers/klipper-build:latest --python 3.12 py.test -n auto
- name: Test Klippy (Python 3.13)
run: docker run -v $PWD:/klipper dangerklippers/klipper-build:latest --python 3.13 py.test -n auto