File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 11name : Build MakeCode
22
3- # MakeCode has to git clone/checkout this repo commit SHA, so only run this
4- # workflow on pushes, as PRs generate a "merge commit" that is not clonable.
53on :
64 push :
75 branches : ' *'
6+ pull_request :
7+ branches : ' *'
88
99jobs :
1010 build-makecode :
5050 run : |
5151 npm install -g pxt
5252 npm install
53+ # MakeCode has to git clone/checkout this repo commit SHA, the GITHUB_SHA env
54+ # variable from a PR represents the "merge commit" of that PR against main,
55+ # and so that commit is not reachable by MakeCode because it's not pushed anywhere
56+ - name : Set CODAL_MICROBIT_V2_SHA
57+ run : |
58+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
59+ CODAL_MICROBIT_V2_SHA=$(jq -r .pull_request.head.sha < $GITHUB_EVENT_PATH)
60+ else
61+ CODAL_MICROBIT_V2_SHA=${GITHUB_SHA}
62+ fi
63+ echo "CODAL_MICROBIT_V2_SHA=$CODAL_MICROBIT_V2_SHA" >> $GITHUB_ENV
64+ echo "CODAL_MICROBIT_V2_SHA=$CODAL_MICROBIT_V2_SHA"
65+ env :
66+ GITHUB_EVENT_PATH : ${{ github.event_path }}
5367 - name : Edit pxtarget.json to use this repository and commit
5468 shell : bash
5569 run : |
7993 mbcodal['compileService']['codalTarget']['url'] = mbcodal['compileService']['codalTarget']['url'].replace(
8094 'lancaster-university/codal-microbit-v2', '${GITHUB_REPOSITORY}'
8195 )
82- mbcodal['compileService']['codalTarget']['branch'] = '${GITHUB_SHA }'
96+ mbcodal['compileService']['codalTarget']['branch'] = '${{ env.CODAL_MICROBIT_V2_SHA } }'
8397
8498 with open('pxtarget.json', 'w') as f:
8599 f.write(json.dumps(pxt_target, indent=4))
Original file line number Diff line number Diff line change 11name : Build MicroPython
22
3- # MicroPython has to git clone/checkout this repo commit SHA, so only run this
4- # workflow on pushes, as PRs generate a "merge commit" that is not clonable.
53on :
64 push :
75 branches : ' *'
6+ pull_request :
7+ branches : ' *'
88
99jobs :
1010 build-micropython :
1616 with :
1717 repository : ' microbit-foundation/micropython-microbit-v2'
1818 submodules : ' true'
19+ - name : Manually clone microbit-v2-samples in the lib/codal/libraries folder
20+ uses : actions/checkout@v4
21+ with :
22+ path : lib/codal/libraries/codal-microbit-v2
23+ fetch-depth : ' 0'
24+ submodules : ' recursive'
1925 - name : Setup arm-none-eabi-gcc v10.3
2026 uses : carlosperate/arm-none-eabi-gcc-action@v1
2127 with :
You can’t perform that action at this time.
0 commit comments