firmware 2.0.2 #135
This file contains 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
name: CI | |
on: | |
push: | |
branches: ["**"] | |
pull_request: | |
branches: ["**"] | |
jobs: | |
build-application-windows: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare copy of Arduino source to distribute with Windows | |
run: | | |
mkdir artifact | |
mkdir artifact\miriam-arduino-firmware-source | |
mkdir artifact\miriam-arduino-firmware-source\Serial_003 | |
copy .\Programs\Serial_003\Serial_003.ino .\artifact\miriam-arduino-firmware-source\Serial_003\ | |
copy .\Programs\Serial_003\MyStatusLed.h .\artifact\miriam-arduino-firmware-source\Serial_003\ | |
copy .\Programs\Serial_003\MyStatusLed.cpp .\artifact\miriam-arduino-firmware-source\Serial_003\ | |
copy .\Programs\README-arduino-firmware.md .\artifact\miriam-arduino-firmware-source\README.md | |
- name: Make Arduino library | |
run: | | |
Compress-Archive -Path PID_v1 -DestinationPath ..\artifact\miriam-arduino-firmware-source\PID_v1.zip | |
shell: pwsh | |
working-directory: ./Programs | |
- uses: microsoft/setup-msbuild@v1 | |
- uses: NuGet/setup-nuget@v1 | |
- name: Restore Packages | |
run: nuget restore Programs/Serial_003/Miriam_Serial/Miriam.sln | |
- name: build | |
run: msbuild Programs/Serial_003/Miriam_Serial/Miriam.sln /p:Configuration=Release /p:Platform="Any CPU" | |
- name: copy Miriam executable | |
run: copy D:\a\Miriam\Miriam\Programs\Serial_003\Miriam_Serial\MiriamTests\bin\Release\Miriam_Serial.exe artifact\Miriam_Serial.exe | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: miriam | |
path: | | |
artifact/miriam-arduino-firmware-source | |
artifact/Miriam_Serial.exe | |
build-firmware: | |
# Based on https://legion2.github.io/2020/03/27/from-arduino-builder-to-arduino-cli.html | |
# and https://blog.arduino.cc/2019/11/14/arduino-on-github-actions/ | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: arduino/[email protected] | |
- name: Install platform | |
run: | | |
arduino-cli core update-index | |
arduino-cli core install arduino:avr | |
- name: Compile Sketch | |
run: | | |
dir | |
arduino-cli compile --fqbn arduino:avr:mega:cpu=atmega2560 --libraries .\Programs\PID_v1 --output-dir miriam-firmware .\Programs\Serial_003 | |
# Do not upload firmware HEX file because we include the .ino source with | |
# the Windows application. Is is easier for the user becaue unfortunately | |
# flashing a .hex file seems rather painful | |
# https://forum.arduino.cc/index.php?topic=417659.0 . |