File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Check pioasm output files
2+ on : [push, pull_request]
3+
4+ jobs :
5+ check-pioasm-outputs :
6+ # Prevent running twice for PRs from same repo
7+ if : github.repository_owner == 'raspberrypi' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
8+ runs-on : [self-hosted, Linux, X64]
9+
10+ steps :
11+ - name : Checkout
12+ uses : actions/checkout@v4
13+
14+ - name : Checkout pico-sdk/develop
15+ uses : actions/checkout@v4
16+ with :
17+ repository : raspberrypi/pico-sdk
18+ ref : develop
19+ path : pico-sdk
20+
21+ - name : Rebuild pioasm outputs
22+ run : PICO_SDK_PATH=${{github.workspace}}/pico-sdk ./update_pioasm_outputs.sh
23+
24+ - name : Check pioasm outputs for changes
25+ run : |
26+ if git status --porcelain | grep -q '^ M'; then
27+ echo "::error title=outdated-files::Autogenerated pioasm output files are out of date - update by running update_pioasm_outputs.sh"
28+ exit 1
29+ fi
30+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Helper-script to update the pioasm-generated files in pico-examples repo
3+ PIOASM_COMMENT_STRING=" This file is autogenerated by pioasm"
4+ if [ -z $PICO_SDK_PATH ]; then
5+ echo " PICO_SDK_PATH envvar not set"
6+ exit 1
7+ fi
8+ if [ ! -d $PICO_SDK_PATH ]; then
9+ echo " PICO_SDK_PATH envvar ($PICO_SDK_PATH ) is invalid"
10+ exit 1
11+ fi
12+ # convert to absolute path
13+ PICO_SDK_PATH=$( realpath $PICO_SDK_PATH )
14+ BUILD_DIR=$( mktemp -d -p .)
15+ cleanup () {
16+ if [[ -d " $BUILD_DIR " ]]; then
17+ rm -rf " $BUILD_DIR "
18+ fi
19+ }
20+ trap cleanup EXIT
21+ SCRIPTNAME=$( basename " $0 " )
22+ PIOASM_OUTPUT_DIRS=()
23+ while read -r DIRNAME; do
24+ if [ " $DIRNAME " != " $SCRIPTNAME " ]; then
25+ PIOASM_OUTPUT_DIRS+=(" $DIRNAME " )
26+ fi
27+ done <<< " $(git grep -l " $PIOASM_COMMENT_STRING " | cut -d/ -f1-2 | sort | uniq)"
28+ while read -r FILENAME; do
29+ if [ " $FILENAME " != " $SCRIPTNAME " ]; then
30+ rm " $FILENAME "
31+ fi
32+ done <<< " $(git grep -l " $PIOASM_COMMENT_STRING " )"
33+ cmake -S . -B " $BUILD_DIR " -DPICO_SDK_PATH=$PICO_SDK_PATH -DPICO_NO_PICOTOOL=1
34+ for DIRNAME in " ${PIOASM_OUTPUT_DIRS[@]} " ; do
35+ make -j4 -C " $BUILD_DIR /$DIRNAME "
36+ done
37+ cleanup
You can’t perform that action at this time.
0 commit comments