diff --git a/.github/auto-comment.yml b/.github/auto-comment.yml deleted file mode 100644 index a141fb548..000000000 --- a/.github/auto-comment.yml +++ /dev/null @@ -1,12 +0,0 @@ -# Comment to a new issue. -pullRequestOpened: | - Thank you for raising your pull request. - - To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). - - The text of DCO can be read here: https://developercertificate.org/ - For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site. - - By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. - - No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. diff --git a/.github/workflows/check_perf.yml b/.github/workflows/check_perf.yml new file mode 100644 index 000000000..7980a6479 --- /dev/null +++ b/.github/workflows/check_perf.yml @@ -0,0 +1,54 @@ + +name: SO3-LVGL Performance check +on: [push, pull_request, workflow_dispatch] +jobs: + run_perf_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + path: 'lvgl' + + - name: SO3-LVGL building the Docker image + run: | + wget https://raw.githubusercontent.com/smartobjectoriented/so3/40-expand-and-document-lvgl-perf-tests/Dockerfile.lvgl + docker build . -f Dockerfile.lvgl -t so3/virt64 --platform linux/amd64 --build-arg SO3_BRANCH=40-expand-and-document-lvgl-perf-tests + + - name: SO3-LVL Running containerized performance check app + run: docker run --privileged -v $PWD:/host -v /dev:/dev so3/virt64 + + - name: Store performance data as artifact + uses: actions/upload-artifact@v4 + with: + name: performance_data + path: perf_check*.txt + + - name: Find previous successful run + id: prev_success_run + run: | + wget ${{ github.api_url }}/repos/${{ github.repository }}/actions/workflows/52959381/runs + echo "ID=$(python3 lvgl/scripts/last_success_run_id.py runs)" >> "$GITHUB_OUTPUT" + + - name: Retrieve previous successful run performance data + if: ${{ steps.prev_success_run.outputs.ID != 0 }} + uses: actions/download-artifact@v4 + with: + name: performance_data + path: prev_performance_data + run-id: ${{ steps.prev_success_run.outputs.ID }} + continue-on-error: true + + - name: Performance report generation + id: perf_report + run: | + python3 lvgl/scripts/perf_report.py perf_check*.txt lvgl/tests/perf/func_thresholds.txt prev_performance_data/perf_check*.txt | tee perf_report.txt + python_return=${PIPESTATUS[0]} + echo "Python script returned $python_return" + exit $python_return + + - name: Store performance report as artifact + if: success() || failure() + uses: actions/upload-artifact@v4 + with: + name: performance_report + path: perf_report.txt diff --git a/docs/cicd/LvglCheckPerfAction.png b/docs/cicd/LvglCheckPerfAction.png new file mode 100644 index 000000000..013e2bc70 Binary files /dev/null and b/docs/cicd/LvglCheckPerfAction.png differ diff --git a/docs/cicd/index.rst b/docs/cicd/index.rst new file mode 100644 index 000000000..06f02c4f0 --- /dev/null +++ b/docs/cicd/index.rst @@ -0,0 +1,89 @@ +.. _cicd: + +============ +CICD +============ + +LVGL uses github actions to perform various operations on the code + + +Main Actions +------------ + +- Micropython build +- C/C++ build +- Documentation build +- PlatformIO publishing +- Release +- Performance test + +LVGL Performance Test +--------------------- + +SO3 is used to check the performance of LVGL. This workflow behaves as shown in this diagram: + +.. image:: LvglCheckPerfAction.png + +The actions are described below + +#. Retrieve the LVGL commit that triggered the action and store it in a "lvgl_base" folder for the dockerfile to use +#. Retrieve "Dockerfile.lvgl" from the SO3 repository and build the docker image +#. Run the docker image to generate the performance data (function execution times) +#. Store the performance data as an artifact for future reference +#. Find previous successful action run and recover the performance data from it +#. Process the performance data and compare it to previous executions and set thresholds to detect performance issues +#. Create an artifact in the form of a log file that shows the output of the regression test + +The image is ran using two volumes: One that redirects the container's "/host" folder to the workflow's working directory and one that allows the container to access the workflow's devices (in the /dev folder) as his own + +The workflow is setup to run when +* Commits are pushed to LVGL's repo +* A pull request is created +* Launched from another workflow + +Dockerfile +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +LVGL's check_perf workflow uses the Dockerfile.lvgl found at the root of this repository to create the image that runs SO3 on qemu and executes the tests. The dockerfile does the following: + +#. Creates an Alpine image and installs all the necessary tools (like gcc and qemu) +#. Recovers SO3's main branch in the root ("/") folder +#. Empties the "*/so3/usr/lib/lvgl*" folder and replaces its content with the LVGL repo to be tested (The LVGL code should be in a "lvgl_base" folder) +#. Patches SO3 so it executes the *prof_test* application instead of the shell at launch +#. Builds U-boot and the SO3 kernel +#. Imports the *prof_test* (*test/perf* folder from LVGL) application into SO3's userspace and builds the userspace +#. Sets up the image so it exposes the port 1234 when ran and executes "./st" + +Performance data files +^^^^^^^^^^^^^^^^^^^^^^^ + +The files used to report on the execution times of the profiled functions and have the same format: + +* 1 header line with no defined format (ignored by the script) +* N lines with function data following the "[parent/] [(info)] |