Skip to content

Commit

Permalink
CI: Sync tooling with inky-frame.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Feb 7, 2025
1 parent cf35ec5 commit 7cffdc5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
RELEASE_FILE: ${{ matrix.name }}-${{ github.event.release.tag_name || github.sha }}-micropython
CI_PROJECT_ROOT: ${{ github.workspace }}/src-${{ github.sha }}
CI_BUILD_ROOT: ${{ github.workspace }}
CI_USE_ENV: 1

steps:
- name: Compiler Cache Fixup
Expand Down
26 changes: 15 additions & 11 deletions ci/micropython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ PIMORONI_PICO_VERSION="feature/picovector2-and-layers"
PY_DECL_VERSION="v0.0.3"
DIR2UF2_VERSION="v0.0.9"

if [ -z ${CI_PROJECT_ROOT+x} ]; then
SCRIPT_PATH="$(dirname $0)"
CI_PROJECT_ROOT=$(realpath "$SCRIPT_PATH/..")
fi

if [ -z ${CI_BUILD_ROOT+x} ]; then
CI_BUILD_ROOT=$(pwd)
fi


function log_success {
echo -e "$(tput setaf 2)$1$(tput sgr0)"
Expand Down Expand Up @@ -102,8 +93,8 @@ function ci_cmake_configure {
BOARD=$1
TOOLS_DIR="$CI_BUILD_ROOT/tools"
MICROPY_BOARD_DIR=$CI_PROJECT_ROOT/boards/$BOARD
if [ ! -f "$MICROPY_BOARD_DIR/mpconfigboard.cmake" ]; then
log_warning "Invalid board: $MICROPY_BOARD_DIR"
if [ ! -f "$MICROPY_BOARD_DIR/mpconfigboard.h" ]; then
log_warning "Invalid board: \"$BOARD\". Run with ci_cmake_configure <board_name>."
return 1
fi
USER_C_MODULES_FILE="$CI_PROJECT_ROOT/boards/usermod-common.cmake"
Expand All @@ -112,6 +103,7 @@ function ci_cmake_configure {
-DPICOTOOL_FORCE_FETCH_FROM_GIT=1 \
-DPICO_BUILD_DOCS=0 \
-DPICO_NO_COPRO_DIS=1 \
-DPICOTOOL_FETCH_FROM_GIT_PATH="$TOOLS_DIR/picotool" \
-DPIMORONI_PICO_PATH="$CI_BUILD_ROOT/pimoroni-pico" \
-DPIMORONI_TOOLS_DIR="$TOOLS_DIR" \
-DUSER_C_MODULES="$USER_C_MODULES_FILE" \
Expand All @@ -124,6 +116,10 @@ function ci_cmake_configure {
function ci_cmake_build {
BOARD=$1
MICROPY_BOARD_DIR=$CI_PROJECT_ROOT/boards/$BOARD
if [ ! -f "$MICROPY_BOARD_DIR/mpconfigboard.h" ]; then
log_warning "Invalid board: \"$BOARD\". Run with ci_cmake_build <board_name>."
return 1
fi
BUILD_DIR="$CI_BUILD_ROOT/build-$BOARD"
ccache --zero-stats || true
cmake --build $BUILD_DIR -j 2
Expand All @@ -137,3 +133,11 @@ function ci_cmake_build {
cp "$BUILD_DIR/firmware-with-filesystem.uf2" $BOARD-with-filesystem.uf2
fi
}

if [ -z ${CI_USE_ENV+x} ] || [ -z ${CI_PROJECT_ROOT+x} ] || [ -z ${CI_BUILD_ROOT+x} ]; then
SCRIPT_PATH="$(dirname $0)"
CI_PROJECT_ROOT=$(realpath "$SCRIPT_PATH/..")
CI_BUILD_ROOT=$(pwd)
fi

ci_debug

0 comments on commit 7cffdc5

Please sign in to comment.