Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous integration with GitHub actions #85

Open
2 tasks
KenVanHoeylandt opened this issue Mar 10, 2024 · 2 comments
Open
2 tasks

Continuous integration with GitHub actions #85

KenVanHoeylandt opened this issue Mar 10, 2024 · 2 comments

Comments

@KenVanHoeylandt
Copy link
Contributor

KenVanHoeylandt commented Mar 10, 2024

I was trying to implement CI to ensure the component compiles for the various versions of ESP-IDF.

The problem is that the project is not set up in a way that allows for this:
ESP-IDF components should be in a subfolder (commonly main/, but it could also be M5GFX/). Without this, any attempt to compile the component with idf.py build leads to this error:

Called idf_component_register from a non-component directory.

Reference build: https://github.com/KenVanHoeylandt/M5GFX/actions/runs/8222729252/job/22484559726

.github/workflows/build.yml example:

name: Build
on: [push]
jobs:
  build-esp-idf-4.4:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
        with:
          submodules: recursive
      - name: build
        uses: espressif/esp-idf-ci-action@main
        with:
          esp_idf_version: v4.4
          target: esp32

To allow for idf.py build to work independently in this project, these steps are required:

  • Add a subfolder for this component (main/ or M5GFX/), move relevant files into this folder and add a CMakeLists.txt
  • Add include($ENV{IDF_PATH}/tools/cmake/project.cmake) to the root CMakeLists.txt

Considering that moving source files has a big impact on your currently unmerged branches, I figured I'd open this issue to discuss the proposed changes.

@lovyan03
Copy link
Collaborator

Hello, @KenVanHoeylandt
Sorry, it's my lack of understanding and I don't quite understand what you're asking.
Are you saying you want the main source code of the library to be in main instead of src?

@KenVanHoeylandt
Copy link
Contributor Author

KenVanHoeylandt commented Oct 19, 2024

Almost: I suggest to move the src folder into a subfolder (e.g. main or M5GFX).

Having src in its own folder allows us to create an ESP-IDF "module" (~ library/subproject).
I could make the CMakeList.txt files that would go along with it.

Once you have this module, you can compile it standalone, and thus we can avoid releases with compile errors as we can automate building.

The same could be done for the M5Unified project.

Sorry for the slow response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants