I am trying a very basic GitHub CI actions with my PlatformIO project. I am using almost the official Workflow provided by the documentation, the difference is that my PIO project is located in a sub folder in the repository. Here below is my main.yml
(probably the most interesting part is the last one):
name: PlatformIO CI
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
working-directory: ./firmware
run: pio run -e debug -v
However, the workflow always fails when running PIO with the following error:
##[debug]Evaluating condition for step: 'Run PlatformIO'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run PlatformIO
##[debug]Loading inputs
##[debug]Loading env
Run pio run -e debug -v
##[debug]/usr/bin/bash -e /home/runner/work/_temp/957a9010-906c-485a-90c4-d7821ce1e555.sh
Error: No such file or directory
##[debug]System.ComponentModel.Win32Exception (2): No such file or directory
##[debug] at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
##[debug] at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
##[debug] at System.Diagnostics.Process.Start()
##[debug] at GitHub.Runner.Sdk.ProcessInvoker.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
##[debug] at GitHub.Runner.Common.ProcessInvokerWrapper.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
##[debug] at GitHub.Runner.Worker.Handlers.DefaultStepHost.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Boolean inheritConsoleHandler, CancellationToken cancellationToken)
##[debug] at GitHub.Runner.Worker.Handlers.ScriptHandler.RunAsync(ActionRunStage stage)
##[debug] at GitHub.Runner.Worker.ActionRunner.RunAsync()
##[debug] at GitHub.Runner.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
##[debug]Finishing: Run PlatformIO
Could anyone please support me to fix it? The error is totally not clear, so I am not sure what is missing.
Using windows-latest
as runs-on
works properly! Anyway, I would very much like to get it working also using Ubuntu as well.
Here is my platformio.ini
(in case it is needed):
; PlatformIO Project Configuration File
[platformio]
default_envs = debug
[common]
framework = arduino
lib_ldf_mode = chain
monitor_speed = 115200
build_unflags =
-std=c++11
-fno-exceptions
build_flags =
-std=c++17
-fexceptions
-D SERIAL_BAUD_RATE=${common.monitor_speed}
; -D NO_GLOBAL_INSTANCES
board_build.filesystem = littlefs
;extra_scripts =
; ./littlefsbuilder.py
lib_deps =
bblanchon/ArduinoJson @ ^6.17.2
https://github.com/lorol/LITTLEFS.git#fe1369cc504a280ead022970ccecd5b8fe3e31b8
https://github.com/Links2004/arduinoWebSockets.git#a14b6b73b4f05e189ca49d6e84202c2b55db528a
madhephaestus/ESP32Servo @ ^0.9.0
https://github.com/MohammedNoureldin/CmdParser.git#e07f25fdf1bb9ddb135307e2ffafea7124a0e624
firmware_version = '"0.1.0+${UNIX_TIME}"'
[esp32_base]
platform = espressif32
board = esp32dev
platform_packages =
; Uses new tool chain with a non-released Arduino package to be able to compile with C++17 (C++17 may become the default in the future, therefore this may be soon not necessary).
toolchain-xtensa@~5.100200.0
framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#93bcf5f2502dbc448ddb93cdcfb789ce14e574b9
board_build.partitions = default.csv
board_build.f_cpu = 80000000L
[env:release]
extends = esp32_base, common
build_flags =
${common.build_flags}
-D RELEASE
-D FIRMWARE_VERSION=${common.firmware_version}
-D FIRMWARE_URL='"https://XXX.execute-api.eu-central-1.amazonaws.com/dev/firmware-file-if-newer/${common.firmware_version}"'
-D MESSAGING_ENDPOINT_HOST='"XXX.execute-api.eu-central-1.amazonaws.com"'
-D MESSAGING_ENDPOINT_PORT="443"
-D MESSAGING_ENDPOINT_URL='"/dev"'
[env:debug]
extends = env:release
build_type = debug
build_flags =
${common.build_flags}
-D DEBUG
-D DEBUG_ESP_PORT=Serial
-D CORE_DEBUG_LEVEL=4
-D FIRMWARE_VERSION=${common.firmware_version}
-D FIRMWARE_URL='"https://XXX.execute-api.eu-central-1.amazonaws.com/dev/firmware-file-if-newer/${common.firmware_version}"'
-D MESSAGING_ENDPOINT_HOST='"XXX.amazonaws.com"'
-D MESSAGING_ENDPOINT_PORT="443"
-D MESSAGING_ENDPOINT_URL='"/dev"'
[env:native_test]
platform = native
lib_compat_mode = off
lib_extra_dirs =
test/ESP8266-Arduino-GMocks
lib_deps =
${common.lib_deps}
google/googletest @ ^1.10.0
build_flags =
; -I "${platformio.test_dir}/ESP8266-Arduino-GMocks/"