From 357e9a05ec85b33e85f0048c61dfce2e92702b3c Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Wed, 1 May 2024 14:16:40 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20CI=20with=20BOARD=5FSIMULA?= =?UTF-8?q?TED=20(#1050)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ellensp <530024+ellensp@users.noreply.github.com> --- .github/workflows/build-pr.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index e0bdab950b..e133a945d2 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -69,6 +69,13 @@ jobs: pio upgrade --dev pio pkg update --global + - name: Install Simulator dependencies + run: | + sudo apt-get install build-essential + sudo apt-get install libsdl2-dev + sudo apt-get install libsdl2-net-dev + sudo apt-get install libglm-dev + # Fetch the code from the other repo and compile it: - name: Clone Marlin run: | @@ -93,11 +100,15 @@ jobs: [[ -z $MB ]] && { echo "::error::Can't read MOTHERBOARD setting." ; exit 3; } BLINE=$( grep -E "define\s+BOARD_$MB\b" Marlin/src/core/boards.h ) - BNUM=$( sed -E 's/^.+BOARD_[^ ]+ +([0-9]+).+$/\1/' <<<"$BLINE" ) + BNUM=$( sed -E 's/^.+BOARD_[^ ]+ +([0-9]+)(.|$)+$/\1/' <<<"$BLINE" ) BDESC=$( sed -E 's/^.+\/\/ *(.+)$/\1/' <<<"$BLINE" ) [[ -z $BNUM ]] && { echo "::error::Can't find BOARD_$MB in core/boards.h." ; exit 3; } - - ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E "#include.+//.+env:[^ ]+" | grep -oE "env:[^ ]+" | sed -E "s/env://" ) ) + if [ "$MB" == "SIMULATED" ] + then + ENVS=$"simulator_linux_release" + else + ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E "#include.+//.+env:[^ ]+" | grep -oE "env:[^ ]+" | sed -E "s/env://" ) ) + fi [[ -z $ENVS ]] && { echo "::error::Can't find target(s) for $MB ($BNUM)." ; exit 3; } [[ ${#ENVS[*]} == 1 ]] && TARGET=$ENVS || TARGET="${ENVS[0]}"