Skip to content

Commit f29d2bf

Browse files
committed
CI: Sync tooling with inky-frame.
See: pimoroni/inky-frame#6
1 parent cf35ec5 commit f29d2bf

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

ci/micropython.sh

+15-11
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ PIMORONI_PICO_VERSION="feature/picovector2-and-layers"
99
PY_DECL_VERSION="v0.0.3"
1010
DIR2UF2_VERSION="v0.0.9"
1111

12-
if [ -z ${CI_PROJECT_ROOT+x} ]; then
13-
SCRIPT_PATH="$(dirname $0)"
14-
CI_PROJECT_ROOT=$(realpath "$SCRIPT_PATH/..")
15-
fi
16-
17-
if [ -z ${CI_BUILD_ROOT+x} ]; then
18-
CI_BUILD_ROOT=$(pwd)
19-
fi
20-
2112

2213
function log_success {
2314
echo -e "$(tput setaf 2)$1$(tput sgr0)"
@@ -102,8 +93,8 @@ function ci_cmake_configure {
10293
BOARD=$1
10394
TOOLS_DIR="$CI_BUILD_ROOT/tools"
10495
MICROPY_BOARD_DIR=$CI_PROJECT_ROOT/boards/$BOARD
105-
if [ ! -f "$MICROPY_BOARD_DIR/mpconfigboard.cmake" ]; then
106-
log_warning "Invalid board: $MICROPY_BOARD_DIR"
96+
if [ ! -f "$MICROPY_BOARD_DIR/usermodules.cmake" ]; then
97+
log_warning "Invalid board: \"$BOARD\". Run with ci_cmake_configure <board_name>."
10798
return 1
10899
fi
109100
USER_C_MODULES_FILE="$CI_PROJECT_ROOT/boards/usermod-common.cmake"
@@ -112,6 +103,7 @@ function ci_cmake_configure {
112103
-DPICOTOOL_FORCE_FETCH_FROM_GIT=1 \
113104
-DPICO_BUILD_DOCS=0 \
114105
-DPICO_NO_COPRO_DIS=1 \
106+
-DPICOTOOL_FETCH_FROM_GIT_PATH="$TOOLS_DIR/picotool" \
115107
-DPIMORONI_PICO_PATH="$CI_BUILD_ROOT/pimoroni-pico" \
116108
-DPIMORONI_TOOLS_DIR="$TOOLS_DIR" \
117109
-DUSER_C_MODULES="$USER_C_MODULES_FILE" \
@@ -124,6 +116,10 @@ function ci_cmake_configure {
124116
function ci_cmake_build {
125117
BOARD=$1
126118
MICROPY_BOARD_DIR=$CI_PROJECT_ROOT/boards/$BOARD
119+
if [ ! -f "$MICROPY_BOARD_DIR/usermodules.cmake" ]; then
120+
log_warning "Invalid board: \"$BOARD\". Run with ci_cmake_build <board_name>."
121+
return 1
122+
fi
127123
BUILD_DIR="$CI_BUILD_ROOT/build-$BOARD"
128124
ccache --zero-stats || true
129125
cmake --build $BUILD_DIR -j 2
@@ -137,3 +133,11 @@ function ci_cmake_build {
137133
cp "$BUILD_DIR/firmware-with-filesystem.uf2" $BOARD-with-filesystem.uf2
138134
fi
139135
}
136+
137+
if [ -z ${CI_USE_ENV+x} ] || [ -z ${CI_PROJECT_ROOT+x} ] || [ -z ${CI_BUILD_ROOT+x} ]; then
138+
SCRIPT_PATH="$(dirname $0)"
139+
CI_PROJECT_ROOT=$(realpath "$SCRIPT_PATH/..")
140+
CI_BUILD_ROOT=$(pwd)
141+
fi
142+
143+
ci_debug

0 commit comments

Comments
 (0)