-
Notifications
You must be signed in to change notification settings - Fork 0
Add platformIO in all projects. Modify actions to compile with pio #14
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,83 +1,50 @@ | ||
| # This is the name of the workflow, visible on GitHub UI. | ||
| name: build | ||
|
|
||
| # Here we tell GitHub to run the workflow when a commit | ||
| # is pushed or a Pull Request is opened. | ||
| on: [push, pull_request] | ||
|
|
||
| # This is the list of jobs that will be run concurrently. | ||
| # Since we use a build matrix, the actual number of jobs | ||
| # started depends on how many configurations the matrix | ||
| # will produce. | ||
| jobs: | ||
| # This is the name of the job - can be whatever. | ||
| build: | ||
|
|
||
| # Here we tell GitHub that the jobs must be determined | ||
| # dynamically depending on a matrix configuration. | ||
| strategy: | ||
| matrix: | ||
| # The matrix will produce one job for each configuration | ||
| # parameter of type `arduino-platform`, in this case a | ||
| # total of 2. | ||
| arduino-platform: ["arduino:avr","esp8266:esp8266"] | ||
| # This is usually optional but we need to statically define the | ||
| # FQBN of the boards we want to test for each platform. In the | ||
| # future the CLI might automatically detect and download the core | ||
| # needed to compile against a certain FQBN, at that point the | ||
| # following `include` section will be useless. | ||
| include: | ||
| # This works like this: when the platform is "arduino:samd", the | ||
| # variable `fqbn` is set to "arduino:samd:nano_33_iot". | ||
| - arduino-platform: "arduino:avr" | ||
| fqbn: "arduino:avr:pro:cpu=8MHzatmega328" | ||
| - arduino-platform: "arduino:avr" | ||
| libraries: "LowPower_LowPowerLab" | ||
| - arduino-platform: "arduino:avr" | ||
| project_dir: "Firmware_Arduino" | ||
|
|
||
| - arduino-platform: "esp8266:esp8266" | ||
| fqbn: "esp8266:esp8266:generic" | ||
| - arduino-platform: "esp8266:esp8266" | ||
| libraries: "LiquidCrystal_PCF8574" | ||
| - arduino-platform: "esp8266:esp8266" | ||
| project_dir: "Firmware_ESP8266" | ||
|
|
||
| # This is the platform GitHub will use to run our workflow, we | ||
| # pick Windows for no particular reason. | ||
| runs-on: windows-latest | ||
| project_dir: ["Firmware_Arduino", "Firmware_ESP8266"] | ||
| runs-on: ubuntu-latest | ||
|
|
||
| # This is the list of steps this job will run. | ||
| steps: | ||
| # First of all, we clone the repo using the `checkout` action. | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # We use the `arduino/setup-arduino-cli` action to install and | ||
| # configure the Arduino CLI on the system. | ||
| - name: Setup Arduino CLI | ||
| uses: arduino/setup-arduino-cli@v1 | ||
|
|
||
| # We then install the platform, which one will be determined | ||
| # dynamically by the build matrix. | ||
| - name: Install platform | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - name: Cache PlatformIO | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.platformio | ||
| key: pio-${{ runner.os }}-${{ hashFiles(format('{0}/platformio.ini', matrix.project_dir)) }} | ||
| restore-keys: | | ||
| pio-${{ runner.os }}- | ||
|
|
||
| - name: Install PlatformIO Core | ||
| run: pip install -U platformio | ||
|
|
||
| # Builds all environments defined in platformio.ini; use -e for environment matrix | ||
| - name: Build ${{ matrix.project_dir }} | ||
| working-directory: ${{ matrix.project_dir }} | ||
| run: | | ||
| arduino-cli core update-index --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json | ||
| arduino-cli core install ${{ matrix.arduino-platform }} --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json | ||
|
|
||
| # We then install the platform, which one will be determined | ||
| # dynamically by the build matrix. | ||
| - name: Install libraries | ||
| run: | | ||
| arduino-cli lib install ${{ matrix.libraries }} | ||
| arduino-cli lib list | ||
|
|
||
| # Update submodules | ||
| - name: Update submodules | ||
| run: | | ||
| git submodule update --init --recursive | ||
|
|
||
| # Finally, we compile the sketch, using the FQBN that was set | ||
| # in the build matrix. | ||
| - name: Compile Sketches | ||
| run: arduino-cli compile --fqbn ${{ matrix.fqbn }} --build-path "${{ matrix.project_dir }}/build" ./${{ matrix.project_dir }} | ||
| pio run | ||
| # If defining environment matrix: pio run -e ${{ matrix.env }} | ||
|
|
||
| # Upload generated artifacts; hex for AVR; bin for ESP8266 | ||
| - name: Upload artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.project_dir }}-artifacts | ||
| path: | | ||
| ${{ matrix.project_dir }}/.pio/build/*/*.hex | ||
| ${{ matrix.project_dir }}/.pio/build/*/*.bin | ||
| ${{ matrix.project_dir }}/.pio/build/*/*.elf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .pio | ||
| .vscode/.browse.c_cpp.db* | ||
| .vscode/c_cpp_properties.json | ||
| .vscode/launch.json | ||
| .vscode/ipch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [platformio] | ||
| src_dir = . | ||
|
|
||
| [env:promini_8mhz] | ||
| platform = atmelavr | ||
| board = pro8MHzatmega328 | ||
| framework = arduino | ||
| upload_protocol = arduino | ||
|
|
||
| build_src_filter = | ||
| +<**/*.ino> | ||
| +<**/*.cpp> | ||
| -<**/*.c> | ||
|
|
||
| lib_deps = | ||
| rocketscream/Low-Power @ ^1.6.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .pio | ||
| .vscode/.browse.c_cpp.db* | ||
| .vscode/c_cpp_properties.json | ||
| .vscode/launch.json | ||
| .vscode/ipch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,26 @@ | ||
| [platformio] | ||
| default_envs = esp8266 | ||
| src_dir = Firmware_ESP8266 | ||
| src_dir = . | ||
|
|
||
| [env:esp8266] | ||
| platform = espressif8266 | ||
| board = esp12e ; generic ESP8266 module | ||
| board = esp12e | ||
| framework = arduino | ||
| board_build.flash_size = 4M1M | ||
| board_build.flash_mode = dout | ||
| board_build.f_cpu = 80000000L | ||
| board_build.f_flash = 40000000L | ||
|
|
||
| upload_protocol = espota | ||
| upload_port = RollerShutterControlPanel.local | ||
| upload_resetmethod = ck | ||
| upload_speed = 3000000 | ||
|
|
||
| check_tool = cppcheck | ||
| check_skip_packages = yes ; don’t scan framework/toolchain headers :contentReference[oaicite:0]{index=0} | ||
| check_skip_packages = yes | ||
|
|
||
| build_src_filter = | ||
| +<*.ino> | ||
| +<*.cpp> | ||
| -<*.c> | ||
| +<**/*.ino> | ||
| +<**/*.cpp> | ||
| -<**/*.c> | ||
|
|
||
| lib_deps = | ||
| https://github.com/arduino-libraries/NTPClient.git#3.2.0 | ||
| https://github.com/mathertel/LiquidCrystal_PCF8574.git#2.2.0 | ||
| https://github.com/mathertel/LiquidCrystal_PCF8574.git#2.2.0 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.