Page 1 of 1

Github actions & IDF Component Manager

Posted: Sat Jan 06, 2024 10:05 pm
by kaspernyhus
I'm trying to use the espressif github actions `espressif/esp-idf-ci-action@v1` to build a project in my CI pipeline that uses the IDF Component Manager to fetch a component from a private github repo.

I made a test project with this manifest file:

idf_component.yml

Code: Select all

## IDF Component Manager Manifest File
dependencies:
  espressif/button: "^2.5.0"
  ## Required IDF version
  idf:
    version: ">=4.1.0"

  # For components in git repository:
  esp_arithmetic:
    path: "./component_add"
    version: "*"
    git: "git@github.com:kaspernyhus/multi_component_test.git"
because this repo is private github actions cannot fetch this code.
The authenticity of host 'github.com' can't be established.
ECDSA key fingerprint is


How can I give the IDF Component Manager running on github access to this private git repo?

Thanks!

Re: Github actions & IDF Component Manager

Posted: Mon Jan 08, 2024 11:07 pm
by kaspernyhus
I have tried including ssh-agent in the workflow and passing ssh keys from repo secrets, and setting known_hosts in different ways but I still get the error:
The authenticity of host 'github.com (140.82.112.3)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
the only solution I can think of right now is to check 'managed_components' and 'dependencies.lock' into git and make sure that the versions match so the workflow wont have to update the dependencies.

That doesn't seem to be the most elegant solution though...

Re: Github actions & IDF Component Manager

Posted: Wed Jan 10, 2024 12:23 pm
by kaspernyhus
and I suspect that it will only work with esp-idf v.5 and above.

Tried building in CI with managed_components folder and dependencies.lock checked in with esp-idf v4.4.4 and it doesn't work. Even though the manifest files haven't changed it seems the build system tries to connect to the private repo.

With esp-idf v5.1.1 it works...

Re: Github actions & IDF Component Manager

Posted: Wed Jan 10, 2024 2:29 pm
by kaspernyhus
might have found the solution in the docs:

https://docs.espressif.com/projects/idf ... n-manifest

but I struggle with getting the component manager to read the environment variable set in github actions because these might not get passed into the docker image running the build

Re: Github actions & IDF Component Manager

Posted: Wed Jan 10, 2024 4:29 pm
by kaspernyhus
Here is a modified workflow that allows for passing an access token

https://github.com/kaspernyhus/esp-idf-ci-action

.github/workflows

Code: Select all

name: build-esp-application
run-name: "${{ github.actor }}: building esp-idf application"
on: [pull_request, push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repo
      uses: actions/checkout@v2

    - name: Build with ESP-IDF
      uses: kaspernyhus/esp-idf-ci-action@v1
      with:
        access_token: ${{ secrets.ACCESS_TOKEN }}
        esp_idf_version: v4.4.4
        target: esp32s3
idf_component.yml

Code: Select all

## IDF Component Manager Manifest File
dependencies:
  espressif/button: "^2.5.0"
  ## Required IDF version
  idf:
    version: ">=4.1.0"

  # For components in git repository:
  esp_arithmetic:
    path: "./component_add"
    version: "*"
    git: https://$ACCESS_TOKEN@github.com/kaspernyhus/multi_component_test.git