Skip to content

Commit

Permalink
Workaround GitHub source meddling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Dec 2, 2024
1 parent ffd99fe commit 8f9ac9c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ jobs:
- name: "Prepare tools & dependencies"
shell: bash
run: |
. $BUILD_TOOLS
source $BUILD_TOOLS && ci_github_actions_fixup
ci_apt_install_build_deps
ci_prepare_all
- name: "MicroPython: Configure"
shell: bash
run: |
. $BUILD_TOOLS
source $BUILD_TOOLS && ci_github_actions_fixup
micropython_version
ci_cmake_configure ${{ matrix.name }}
- name: "MicroPython: Build"
shell: bash
run: |
. $BUILD_TOOLS
source $BUILD_TOOLS && ci_github_actions_fixup
ci_cmake_build ${{ matrix.name }}
mv build-${{ matrix.name }}.uf2 ${{ env.RELEASE_FILE }}.uf2
Expand Down
14 changes: 10 additions & 4 deletions ci/micropython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ function ci_prepare_all {
ci_micropython_build_mpy_cross
}

function ci_github_actions_fixup {
# GitHub Actions meddles with . and source causing our paths to be broken
# This fixup attempts to put things right
export CI_PROJECT_ROOT="$(pwd)"
export CI_BUILD_ROOT="$(pwd)/build"
mkdir -p "$CI_BUILD_ROOT"
log_inform "Project root: $CI_PROJECT_ROOT"
log_inform "Build root: $CI_BUILD_ROOT"
}

function micropython_version {
BOARD=$1
echo "MICROPY_GIT_TAG=$MICROPYTHON_VERSION, $BOARD $TAG_OR_SHA" >> $GITHUB_ENV
Expand Down Expand Up @@ -111,7 +121,3 @@ function ci_cmake_build {
log_inform "Copying .uf2 to $(pwd)/$BOARD.uf2"
cp build-$BOARD/firmware.uf2 $BOARD.uf2
}

log_inform "Script path: $SCRIPT_PATH"
log_inform "Project root: $CI_PROJECT_ROOT"
log_inform "Build root: $CI_BUILD_ROOT"

0 comments on commit 8f9ac9c

Please sign in to comment.