Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Nov 16, 2023
1 parent c7a8a89 commit beed355
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
- name: Clone the microbit-v2-samples repository
uses: actions/checkout@v3
with:
repository: 'lancaster-university/microbit-v2-samples'
repository: 'calliope-edu/microbit-v2-samples'
ref: 'calliope'
# We need to use the checkout action (instead of build.py cloning the
# repository) so that on PRs we can get the commit from the PR merge
- name: Clone this repository in the libraries folder
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/makecode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
# One job builds with the local toolchain, the other with Docker
# FIXME: The current docker image used by pxt-microbit is not publicly accessible via
# FIXME: The current docker image used by pxt-calliope is not publicly accessible via
# a known public registry, so the builds using docker will fail.
# As a temporary measure, let's only build the "nodocker" version and reneable the
# docker build in the future, once we can access the build image.
Expand Down Expand Up @@ -48,10 +48,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Clone the pxt-microbit repo
- name: Clone the pxt-calliope repo
uses: actions/checkout@v3
with:
repository: 'microsoft/pxt-microbit'
repository: 'microsoft/pxt-calliope'
- name: Install MakeCode dependencies
run: |
npm install -g pxt
Expand All @@ -70,22 +70,22 @@ jobs:
pxt_target = json.loads(f.read(), object_pairs_hook=collections.OrderedDict)
try:
mbcodal = pxt_target['variants']['mbcodal']
mbdal = pxt_target['variants']['mbdal']
if mbdal['compileService'] != {}:
msg_exit("Unexpected variants.mbdal.compileService value.")
if mbcodal['compileService']['codalTarget']['url'] != "https://github.com/lancaster-university/codal-microbit-v2":
msg_exit("Unexpected variants.mbcodal.compileService.codalTarget.url value.")
minicodal = pxt_target['variants']['minicodal']
minidal = pxt_target['variants']['minidal']
if minidal['compileService'] != {}:
msg_exit("Unexpected variants.minidal.compileService value.")
if minicodal['compileService']['codalTarget']['url'] != "https://github.com/calliope-edu/codal-microbit-v2":
msg_exit("Unexpected variants.minicodal.compileService.codalTarget.url value.")
# Just need to check this exists, we don't care about the value
_ = mbcodal['compileService']['codalTarget']['branch']
_ = minicodal['compileService']['codalTarget']['branch']
except KeyError as e:
msg_exit('The pxt-microbit/pxtarget.json structure has changed and expected keys are not found.')
msg_exit('The pxt-calliope/pxtarget.json structure has changed and expected keys are not found.')
else:
mbdal['compileService'] = { 'dockerArgs' : ['--env', 'YOTTA_GITHUB_AUTHTOKEN=${{ secrets.YOTTA_GITHUB_AUTHTOKEN }}'] }
mbcodal['compileService']['codalTarget']['url'] = mbcodal['compileService']['codalTarget']['url'].replace(
'lancaster-university/codal-microbit-v2', '${GITHUB_REPOSITORY}'
minidal['compileService'] = { 'dockerArgs' : ['--env', 'YOTTA_GITHUB_AUTHTOKEN=${{ secrets.YOTTA_GITHUB_AUTHTOKEN }}'] }
minicodal['compileService']['codalTarget']['url'] = minicodal['compileService']['codalTarget']['url'].replace(
'calliope-edu/codal-microbit-v2', '${GITHUB_REPOSITORY}'
)
mbcodal['compileService']['codalTarget']['branch'] = '${GITHUB_SHA}'
minicodal['compileService']['codalTarget']['branch'] = '${GITHUB_SHA}'
with open('pxtarget.json', 'w') as f:
f.write(json.dumps(pxt_target, indent=4))
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
- name: Clone MicroPython
uses: actions/checkout@v3
with:
repository: 'microbit-foundation/micropython-microbit-v2'
repository: 'calliope-edu/micropython-microbit-v2'
ref: 'v2.1.2-cmini3'
submodules: 'true'
- name: Setup arm-none-eabi-gcc v10.3
uses: carlosperate/arm-none-eabi-gcc-action@v1
Expand All @@ -36,7 +37,7 @@ jobs:
codal_json = json.loads(f.read(), object_pairs_hook=collections.OrderedDict)
try:
if codal_json['target']['url'] != "https://github.com/lancaster-university/codal-microbit-v2":
if codal_json['target']['url'] != "https://github.com/calliope-edu/codal-microbit-v2":
print("Unexpected target URL value.")
exit(1)
# Just need to check this exists, we don't care about the value
Expand All @@ -46,7 +47,7 @@ jobs:
exit(1)
else:
codal_json['target']['url'] = codal_json['target']['url'].replace(
'lancaster-university/codal-microbit-v2', '${GITHUB_REPOSITORY}'
'calliope-edu/codal-microbit-v2', '${GITHUB_REPOSITORY}'
)
codal_json['target']['branch'] = '${GITHUB_SHA}'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/size-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
- name: Clone the microbit-v2-samples repository
uses: actions/checkout@v3
with:
repository: 'lancaster-university/microbit-v2-samples'
# Unless manually triggered via workflow_dispatch this will be an empty
repository: 'calliope-edu/microbit-v2-samples'
# Unless manually triggered via workflow_dispatch this will be 'calliope'
# string, checking out the default branch
ref: ${{ github.event.inputs.samples-commit }}
ref: ${{ github.event.inputs.samples-commit || 'calliope' }}
# We need to use the checkout action (instead of build.py cloning the
# repository) so that on PRs we can get the commit from the PR merge
- name: Clone this repository in the libraries folder
Expand Down

0 comments on commit beed355

Please sign in to comment.