Hey everyone,
I have a problem with pio ci command. If I build my project locally via the vs code platform io integration and upload it to the mega everything works fine. Unfortunately in CI not. Even if I run the following command locally it does not work
pio ci src/main.cpp --board=megaatmega2560
The problem is that SdFat.h
cant be found… I tried putting the library int the lib folder. Tried different versions. As mentioned above, if I build the project locally everything works fine.
// github workflow
build:
runs-on: ubuntu-latest
steps:
- 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: Install library dependencies
run: cd packages/mc && pio lib -g install 1
- name: Run PlatformIO
run: cd packages/mc && pio ci src/main.cpp --board=megaatmega2560
Here is the error in the pipeline (which is the same as locally)
// Error
Run cd packages/game && pio ci src/main.cpp --board=megaatmega2560
cd packages/game && pio ci src/main.cpp --board=megaatmega2560
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.10.1/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.1/x64/lib
The next files/directories have been created in /tmp/tmpt4cll55k
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File
Project has been successfully initialized! Useful commands:
`pio run` - process/build project from the current directory
`pio run --target upload` or `pio run -t upload` - upload firmware to a target
`pio run --target clean` - clean project (remove compiled files)
`pio run --help` - additional information
Processing megaatmega2560 (platform: atmelavr; board: megaatmega2560; framework: arduino)
--------------------------------------------------------------------------------
Platform Manager: Installing atmelavr
Downloading...
Unpacking...
Platform Manager: atmelavr @ 3.4.0 has been installed!
The platform 'atmelavr' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.
Tool Manager: Installing platformio/toolchain-atmelavr @ ~1.70300.0
Downloading...
Unpacking...
Tool Manager: toolchain-atmelavr @ 1.70300.191015 has been installed!
Tool Manager: Installing platformio/framework-arduino-avr @ ~5.1.0
Downloading...
Unpacking...
Tool Manager: framework-arduino-avr @ 5.1.0 has been installed!
Tool Manager: Installing platformio/tool-scons @ ~4.40300.0
Downloading...
Unpacking...
Tool Manager: tool-scons @ 4.40300.1 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/megaatmega2560.html
PLATFORM: Atmel AVR (3.4.0) > Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)
HARDWARE: ATMEGA2560 16MHz, 8KB RAM, 248KB Flash
DEBUG: Current (avr-stub) On-board (avr-stub, simavr)
PACKAGES:
- framework-arduino-avr 5.1.0
- toolchain-atmelavr 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 6 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SPI> 1.0
Building in release mode
Compiling .pio/build/megaatmega2560/src/main.cpp.o
Compiling .pio/build/megaatmega2560/lib716/SPI/SPI.cpp.o
src/main.cpp:14:10: fatal error: SdFat.h: No such file or directory
***************************************************************
* Looking for SdFat.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:SdFat.h"
* Web > https://platformio.org/lib/search?query=header:SdFat.h
*
***************************************************************
#include <SdFat.h> //Sd Card
^~~~~~~~~
compilation terminated.
*** [.pio/build/megaatmega2560/src/main.cpp.o] Error 1
========================= [FAILED] Took 12.73 seconds =========================
Error: Process completed with exit code 1.
Thanks in advance.
All the best and happy coding.
Kilian