|
| 1 | +name: MicroPython-LVGL CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.ref }}-${{ github.workflow }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + build-lvgl-micropython: |
| 14 | + |
| 15 | + runs-on: ubuntu-24.04 |
| 16 | + continue-on-error: true |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + port: ['unix', 'stm32', 'rp2', 'esp32'] |
| 20 | + steps: |
| 21 | + - uses: ammaraskar/gcc-problem-matcher@master |
| 22 | + - uses: actions/setup-python@v5 |
| 23 | + with: |
| 24 | + python-version: '3.12' |
| 25 | + |
| 26 | + - name: Install Dependencies |
| 27 | + run: | |
| 28 | + sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse" |
| 29 | + sudo apt-get update -y -qq |
| 30 | + sudo apt-get install libsdl2-dev parallel libfreetype-dev librlottie-dev libavformat-dev libavcodec-dev libswscale-dev libavutil-dev build-essential libc-bin |
| 31 | + python3 -m pip install pillow |
| 32 | +
|
| 33 | + - name: Clone lv_micropython |
| 34 | + run: | |
| 35 | + git clone https://github.com/lvgl/lv_micropython.git . |
| 36 | + git checkout master |
| 37 | +
|
| 38 | + - name: Initialize lv_bindings submodule |
| 39 | + run: git submodule update --init --recursive user_modules/lv_binding_micropython |
| 40 | + |
| 41 | + - name: Update ${{ matrix.port }} port submodules |
| 42 | + run: make -C ports/${{ matrix.port}} DEBUG=1 submodules |
| 43 | + |
| 44 | + # - name: Debug GitHub Event |
| 45 | + # run: -${{ tojson(github.event) }} |
| 46 | + # shell: cat {0} |
| 47 | + |
| 48 | + - name: Checkout lv_bindings (push) |
| 49 | + working-directory: ./user_modules/lv_binding_micropython |
| 50 | + if: ${{github.event_name == 'push'}} |
| 51 | + run: | |
| 52 | +
|
| 53 | + git fetch --force ${{ github.event.repository.html_url }} "+${{github.event.ref}}:refs/remotes/origin/${{github.event.head_commit.author.username}}-${{github.event.head_commit.id}}" |
| 54 | + git checkout ${{ github.event.head_commit.id }} |
| 55 | + git submodule update --init --recursive |
| 56 | +
|
| 57 | + - name: Checkout lv_bindings (pull_request) |
| 58 | + working-directory: ./user_modules/lv_binding_micropython |
| 59 | + if: ${{github.event_name == 'pull_request'}} |
| 60 | + run: | |
| 61 | +
|
| 62 | + git fetch --force ${{ github.event.repository.html_url }} "+refs/pull/${{github.event.pull_request.number}}/head:refs/remotes/origin/${{github.event.pull_request.head.ref}}" |
| 63 | + git checkout ${{ github.event.pull_request.head.sha }} |
| 64 | + git submodule update --init --recursive |
| 65 | +
|
| 66 | +
|
| 67 | + - name: Build mpy-cross |
| 68 | + run: make -j $(nproc) -C mpy-cross |
| 69 | + |
| 70 | + # STM32 port |
| 71 | + - name: Build stm32 port |
| 72 | + if: matrix.port == 'stm32' |
| 73 | + run: | |
| 74 | + source tools/ci.sh && ci_stm32_setup |
| 75 | + make -C ports/stm32 BOARD=PYBV11 submodules |
| 76 | + make -j $(nproc) -C ports/stm32 BOARD=PYBV11 USER_C_MODULES=../../user_modules LV_CONF_PATH=../../user_modules/lv_binding_micropython/ports/stm32/lv_conf_stm32.h |
| 77 | + # Raspberry Pi Pico port |
| 78 | + - name: Build rp2 port |
| 79 | + if: matrix.port == 'rp2' |
| 80 | + run: | |
| 81 | + source tools/ci.sh && ci_rp2_setup |
| 82 | + make -C ports/rp2 BOARD=RPI_PICO submodules |
| 83 | + make -j $(nproc) -C ports/rp2 BOARD=RPI_PICO USER_C_MODULES=../../user_modules/lv_binding_micropython/micropython.cmake |
| 84 | +
|
| 85 | + # ESP32 port |
| 86 | + - name: Build esp32 port |
| 87 | + if: matrix.port == 'esp32' |
| 88 | + run: | |
| 89 | + source tools/ci.sh && ci_esp32_idf_setup |
| 90 | + source tools/ci.sh && ci_esp32_build_common |
| 91 | + make -C ports/esp32 BOARD=ESP32_GENERIC_S3 USER_C_MODULES=../../user_modules/lv_binding_micropython/micropython.cmake |
| 92 | +
|
| 93 | + # Unix port |
| 94 | + - name: Build unix port |
| 95 | + if: matrix.port == 'unix' |
| 96 | + run: make -j $(nproc) -C ports/unix DEBUG=1 VARIANT=lvgl |
| 97 | + |
| 98 | + - name: Run MicroPython Tests |
| 99 | + if: matrix.port == 'unix' |
| 100 | + run: MICROPY_MICROPYTHON=ports/unix/build-lvgl/micropython ./tests/run-tests.py -d tests/basics |
| 101 | + |
| 102 | + - name: Run MicroPython-LVGL API Tests |
| 103 | + if: matrix.port == 'unix' |
| 104 | + run: MICROPY_MICROPYTHON=ports/unix/build-lvgl/micropython ./tests/run-tests.py -d user_modules/lv_binding_micropython/tests/api |
| 105 | + |
| 106 | + - name: Process Tests Artifacts |
| 107 | + |
| 108 | + if: matrix.port == 'unix' |
| 109 | + working-directory: ./user_modules/lv_binding_micropython/tests |
| 110 | + run: ./imageconvert.py api/*.bin |
| 111 | + |
| 112 | + - name: Upload Test Artifacts |
| 113 | + if: matrix.port == 'unix' |
| 114 | + uses: actions/upload-artifact@v4 |
| 115 | + with: |
| 116 | + name: API Tests Screenshots |
| 117 | + path: ./user_modules/lv_binding_micropython/tests/api/*.png |
| 118 | + |
| 119 | + # TODO: Fix run.sh catchsegv not found command |
| 120 | + - name: Run tests |
| 121 | + if: matrix.port == 'unix' |
| 122 | + run: | |
| 123 | + export XDG_RUNTIME_DIR=/tmp |
| 124 | + user_modules/lv_binding_micropython/tests/run.sh |
0 commit comments