with deploy #96
Workflow file for this run
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: Arduino CI | |
# on which event should we start push, pullrequest or schedule dispatches | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
# python /home/des-epe-team/.arduino15/packages/Infineon/hardware/xmc/3.0.0/tools/xmc-flasher.py upload -d XMC1100-0064 -p /dev/ttyACM0 -f /tmp/arduino/sketches/B91C01BFF3AB128A10FE7B23FF310E46/readAngleTest.ino.hex | |
# we run this on selhosted runner, use labels to be more specific | |
runs-on: | |
- self-hosted | |
- X64 | |
- Linux | |
strategy: | |
matrix: | |
example: [ | |
# examples/E9000SPC, | |
# examples/readAngleSpeedRevolutions, | |
examples/readAngleTest, | |
# examples/readAngleValueProcessing, | |
# examples/readMultipleRegisters, | |
# examples/readSpeedProcessing, | |
# examples/sensorRegisters, | |
# examples/sensorType, | |
# examples/testSensorMainValues, | |
# examples/useMultipleSensors, | |
# examples/writeRegisters | |
] | |
# board packages we want to run | |
platform: [ | |
"arduino:avr", | |
"infineon:xmc" | |
] | |
include: | |
- platform: "arduino:avr" | |
fqbn: arduino:avr:uno | |
- platform: "infineon:xmc" | |
fqbn: Infineon:xmc:XMC1100_XMC2GO | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Arduino CLI | |
uses: arduino/setup-arduino-cli@master | |
- name: Set and check environment, install repos | |
run: | | |
ln -sfn /opt/XMC-for-Arduino ~/.arduino15/packages/Infineon | |
mkdir -p "$HOME/Arduino/libraries" | |
ln -sf $GITHUB_WORKSPACE/ $HOME/Arduino/libraries/magnetic-angle-sensor | |
- name: Install/Update Arduino Platform | |
run: | | |
arduino-cli core update-index | |
arduino-cli core install ${{ matrix.platform }} | |
- name: Compile Sketch | |
run: | | |
arduino-cli compile --fqbn ${{ matrix.fqbn }} --libraries="." --libraries="$HOME/Arduino/libraries/." ${{ matrix.example }} | |
deploy: | |
needs: build | |
runs-on: | |
- self-hosted | |
- X64 | |
- Linux | |
strategy: | |
max-parallel: 1 | |
matrix: | |
example: [ | |
examples/readAngleTest, | |
] | |
# board packages we want to run | |
platform: [ | |
"infineon:xmc" | |
] | |
include: | |
- platform: "infineon:xmc" | |
fqbn: Infineon:xmc:XMC1100_XMC2GO | |
port_name: infineon.xmc.XMC1100_XMC2GO.magnetic-angle-sensor.port_serial.0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Arduino CLI | |
uses: arduino/setup-arduino-cli@master | |
- name: Compile Sketch | |
run: | | |
ln -sfn /opt/XMC-for-Arduino ~/.arduino15/packages/Infineon | |
mkdir -p "$HOME/Arduino/libraries" | |
ln -sf $GITHUB_WORKSPACE/ $HOME/Arduino/libraries/magnetic-angle-sensor | |
arduino-cli compile --fqbn ${{ matrix.fqbn }} --libraries="." --libraries="$HOME/Arduino/libraries/." ${{ matrix.example }} --export-binaries | |
- name: Deploy | |
run: | | |
cd /opt/runner_support/ | |
export SERIAL_NUM=`cat ./board2port.yaml | shyaml get-value ${{ matrix.port_name}}` | |
export PORT=`./find_usb.sh $SERIAL_NUM` | |
echo $PORT | |
python $HOME/.arduino15/packages/Infineon/hardware/xmc/3.0.0/tools/xmc-flasher.py upload -d XMC1402-0064 -p $PORT -f "$HOME/Arduino/libraries/magnetic-angle-sensor/examples/readAngleTest/build/Infineon.xmc.XMC1100_XMC2GO/*.hex" |