Skip to content

Commit

Permalink
Parametric arduino version test
Browse files Browse the repository at this point in the history
  • Loading branch information
OlafFilies committed Oct 23, 2024
1 parent 3cbf80e commit 9c9390c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/fqbn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ hil:
example: "examples/readAngleTest"
baud: 9600
timeout: 10
version: xmc/latest

21 changes: 11 additions & 10 deletions .github/workflows/arduino_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ jobs:
# check wether the .arduino15 packages dir is available
- name: Generate Arduino Library
run: |
if [ ! -d "$HOME/.arduino15/packages/Infineon" ]; then
ln -sn /opt/XMC-for-Arduino/hardware $HOME/.arduino15/packages/Infineon
fi
version=$(echo ${{ toJson(needs.setup.outputs.xfp) }} | jq ".\"hil\".\"version\"" -r --compact-output )
rm ~/.arduino15/packages/Infineon/hardware/xmc/*
ln -s /opt/XMC-for-Arduino/hardware/${{ env.version }}/ ~/.arduino15/packages/Infineon/hardware/${{ env.version }}
mkdir -p "$HOME/Arduino/libraries"
cd $GITHUB_WORKSPACE/
xfp-dev arduino workspace-setup --path $HOME/Arduino/libraries
Expand Down Expand Up @@ -182,9 +182,9 @@ jobs:
# export REPO=${{ needs.setup.outputs.repo }}
- name: Set and check environment, install repos
run: |
if [ ! -d "$HOME/.arduino15/packages/Infineon" ]; then
ln -sn /opt/XMC-for-Arduino/hardware $HOME/.arduino15/packages/Infineon
fi
version=$(echo ${{ toJson(needs.setup.outputs.xfp) }} | jq ".\"hil\".\"version\"" -r --compact-output )
rm ~/.arduino15/packages/Infineon/hardware/xmc/*
ln -s /opt/XMC-for-Arduino/hardware/${{ env.version }}/ ~/.arduino15/packages/Infineon/hardware/${{ env.version }}
mkdir -p "$HOME/Arduino/libraries"
cd $GITHUB_WORKSPACE/
xfp-dev arduino workspace-setup --path $HOME/Arduino/libraries
Expand Down Expand Up @@ -268,6 +268,7 @@ jobs:
echo "example="$(echo ${xfp} | jq ".\"hil\".\"example\"" -r --compact-output ) >> $GITHUB_ENV
echo "baud="$(echo ${xfp} | jq ".\"hil\".\"baud\"" -r --compact-output ) >> $GITHUB_ENV
echo "timeout="$(echo ${xfp} | jq ".\"hil\".\"timeout\"" -r --compact-output ) >> $GITHUB_ENV
echo "version="$(echo ${xfp} | jq ".\"hil\".\"version\"" -r --compact-output ) >> $GITHUB_ENV
echo "Repository name: " $REPO
echo "Project name: " $PROJECT
Expand All @@ -289,9 +290,9 @@ jobs:
run: |
export TMPDIR=$HOME/tmp
mkdir -p $TMPDIR
if [ ! -d "$HOME/.arduino15/packages/Infineon" ]; then
ln -sn /opt/XMC-for-Arduino/hardware $HOME/.arduino15/packages/Infineon
fi
version=$(echo ${{ toJson(needs.setup.outputs.xfp) }} | jq ".\"hil\".\"version\"" -r --compact-output )
rm ~/.arduino15/packages/Infineon/hardware/xmc/*
ln -s /opt/XMC-for-Arduino/hardware/${{ env.version }}/ ~/.arduino15/packages/Infineon/hardware/${{ env.version }}
mkdir -p "$HOME/Arduino/libraries"
cd $HOME/Arduino/libraries/${{ env.project }}
arduino-cli compile --clean --log --warnings all \
Expand All @@ -311,7 +312,7 @@ jobs:
- name: Flash
run: |
cd $HOME
python $HOME/.arduino15/packages/Infineon/hardware/xmc/3.2.0/tools/xmc-flasher.py \
python $HOME/.arduino15/packages/Infineon/hardware/xmc/${{ version }}/tools/xmc-flasher.py \
upload \
-d ${{ env.devtype }} \
-p ${{ env.port }} \
Expand Down

0 comments on commit 9c9390c

Please sign in to comment.