feat: automated testing GitHub action (#134)
This commit is contained in:
69
.github/workflows/test.yml
vendored
Normal file
69
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
name: Smoke Tests
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
klippy_testing:
|
||||
name: Klippy Tests
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
klipper_repo:
|
||||
- klipper3d/klipper
|
||||
- DangerKlippers/danger-klipper
|
||||
steps:
|
||||
- name: Checkout shaketune
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: shaketune
|
||||
- name: Checkout Klipper
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: klipper
|
||||
repository: ${{ matrix.klipper_repo }}
|
||||
ref: master
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential
|
||||
- name: Build klipper dict
|
||||
run: |
|
||||
pushd klipper
|
||||
cp ../shaketune/ci/smoke-test/klipper-smoketest.kconfig .config
|
||||
make olddefconfig
|
||||
make out/compile_time_request.o
|
||||
popd
|
||||
- name: Setup klippy env
|
||||
run: |
|
||||
python3 -m venv --prompt klippy klippy-env
|
||||
./klippy-env/bin/python -m pip install -r klipper/scripts/klippy-requirements.txt
|
||||
./klippy-env/bin/python -m pip install -r shaketune/requirements.txt
|
||||
- name: Install shaketune
|
||||
run: |
|
||||
ln -s $PWD/shaketune/shaketune $PWD/klipper/klippy/extras/shaketune
|
||||
- name: Klipper import test
|
||||
run: |
|
||||
./klippy-env/bin/python klipper/klippy/klippy.py --import-test
|
||||
- name: Klipper integrated test
|
||||
run: |
|
||||
pushd klipper
|
||||
mkdir ../dicts
|
||||
cp ../klipper/out/klipper.dict ../dicts/linux_basic.dict
|
||||
../klippy-env/bin/python scripts/test_klippy.py -d ../dicts ../shaketune/ci/smoke-test/klippy-tests/simple.test
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
cache: 'pip'
|
||||
- name: install ruff
|
||||
run: |
|
||||
pip install ruff
|
||||
- name: run ruff tests
|
||||
run: |
|
||||
ruff check
|
||||
|
||||
|
||||
34
ci/smoke-test/klipper-smoketest.kconfig
Normal file
34
ci/smoke-test/klipper-smoketest.kconfig
Normal file
@@ -0,0 +1,34 @@
|
||||
CONFIG_LOW_LEVEL_OPTIONS=y
|
||||
# CONFIG_MACH_AVR is not set
|
||||
# CONFIG_MACH_ATSAM is not set
|
||||
# CONFIG_MACH_ATSAMD is not set
|
||||
# CONFIG_MACH_LPC176X is not set
|
||||
# CONFIG_MACH_STM32 is not set
|
||||
# CONFIG_MACH_HC32F460 is not set
|
||||
# CONFIG_MACH_RP2040 is not set
|
||||
# CONFIG_MACH_PRU is not set
|
||||
# CONFIG_MACH_AR100 is not set
|
||||
CONFIG_MACH_LINUX=y
|
||||
# CONFIG_MACH_SIMU is not set
|
||||
CONFIG_BOARD_DIRECTORY="linux"
|
||||
CONFIG_CLOCK_FREQ=50000000
|
||||
CONFIG_LINUX_SELECT=y
|
||||
CONFIG_USB_VENDOR_ID=0x1d50
|
||||
CONFIG_USB_DEVICE_ID=0x614e
|
||||
CONFIG_USB_SERIAL_NUMBER="12345"
|
||||
CONFIG_WANT_GPIO_BITBANGING=y
|
||||
CONFIG_WANT_DISPLAYS=y
|
||||
CONFIG_WANT_SENSORS=y
|
||||
CONFIG_WANT_LIS2DW=y
|
||||
CONFIG_WANT_LDC1612=y
|
||||
CONFIG_WANT_SOFTWARE_I2C=y
|
||||
CONFIG_WANT_SOFTWARE_SPI=y
|
||||
CONFIG_NEED_SENSOR_BULK=y
|
||||
CONFIG_CANBUS_FREQUENCY=1000000
|
||||
CONFIG_INITIAL_PINS=""
|
||||
CONFIG_HAVE_GPIO=y
|
||||
CONFIG_HAVE_GPIO_ADC=y
|
||||
CONFIG_HAVE_GPIO_SPI=y
|
||||
CONFIG_HAVE_GPIO_I2C=y
|
||||
CONFIG_HAVE_GPIO_HARD_PWM=y
|
||||
CONFIG_INLINE_STEPPER_HACK=y
|
||||
9
ci/smoke-test/klippy-tests/simple.cfg
Normal file
9
ci/smoke-test/klippy-tests/simple.cfg
Normal file
@@ -0,0 +1,9 @@
|
||||
[mcu]
|
||||
serial: /tmp/klipper_host_mcu
|
||||
|
||||
[printer]
|
||||
kinematics: none
|
||||
max_velocity: 300
|
||||
max_accel: 300
|
||||
|
||||
[shaketune]
|
||||
4
ci/smoke-test/klippy-tests/simple.test
Normal file
4
ci/smoke-test/klippy-tests/simple.test
Normal file
@@ -0,0 +1,4 @@
|
||||
DICTIONARY linux_basic.dict
|
||||
CONFIG simple.cfg
|
||||
|
||||
G4 P1000
|
||||
Reference in New Issue
Block a user