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

Fix the GitHub Actions build #80

Merged
merged 2 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actions/esp-idf-with-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM espressif/idf:release-v5.1
RUN apt update
RUN apt -y install --no-install-recommends nodejs npm
22 changes: 22 additions & 0 deletions .github/actions/esp-idf-with-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Espressif IoT Development Framework (ESP-IDF), plus node.js and npm"
branding:
color: red
icon: wifi
inputs:
target:
description: "ESP32 variant to build for"
default: "esp32"
required: false
command:
description: "Command to run inside the docker container (default: builds the project)"
default: "idf.py build"
required: false
runs:
using: 'docker'
image: 'Dockerfile'
env:
IDF_TARGET: "${{inputs.target}}"
args:
- "/bin/bash"
- "-c"
- "${{inputs.command}}"
38 changes: 8 additions & 30 deletions .github/workflows/esp_idf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,17 @@ on:
jobs:
build_esp32_v5_1:
runs-on: ubuntu-latest
strategy:
matrix:
target: ["esp32", "esp32s2", "esp32s3", "esp32c3"]
fail-fast: false
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup node (npm)
uses: actions/setup-node@v4
- name: ESP-IDF v5.1 build
uses: ./.github/actions/esp-idf-with-node
with:
node-version: 20
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- run: npm --prefix frontend ci
- name: ESP-IDF v5.1 build esp32
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: release-v5.1
target: esp32
command: 'idf.py set-target esp32 build'
- name: ESP-IDF v5.1 build esp32s2
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: release-v5.1
target: esp32s2
command: 'idf.py set-target esp32s2 build'
- name: ESP-IDF v5.1 build esp32s3
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: release-v5.1
target: esp32s3
command: 'idf.py set-target esp32s3 build'
- name: ESP-IDF v5.1 build esp32c3
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: release-v5.1
target: esp32c3
command: 'idf.py set-target esp32c3 build'
target: "${{ matrix.target }}"
command: "idf.py set-target ${{matrix.target}} build"
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_custom_target(
COMMAND cmake -E make_directory "${CMAKE_BINARY_DIR}/frontend"
COMMAND cmake -E make_directory "${CMAKE_SOURCE_DIR}/frontend/build"
# Run frontend npm build process
COMMAND npm install && npm i -D shx && npm run build
COMMAND npm install && npm run build
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/frontend")
# Copy the content of npm to the build directory
add_custom_command(
Expand Down