Skip to content

Commit 092deef

Browse files
committed
ci: Build minimal distribution bundle
This commit updates the CI workflow to build a minimal Zephyr SDK distribution bundle which does not include the target toolchains and allows the required toolchains to be downloaded and installed on-demand using the setup script. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 4b6e3cd commit 092deef

File tree

1 file changed

+36
-24
lines changed

1 file changed

+36
-24
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,24 +1061,6 @@ jobs:
10611061
## Extract CMake package archive
10621062
${EXTRACT} ${ARTIFACT_ROOT}/cmake_${HOST}/cmake_${HOST}.${EXT}
10631063
1064-
# Stage toolchains
1065-
## Generate target list from the workflow matrix
1066-
TARGETS=$(echo '${{ needs.setup.outputs.targets }}' | jq -cr '.[]')
1067-
1068-
## Extract all toolchains
1069-
for TARGET in ${TARGETS}; do
1070-
TOOLCHAIN_ARTIFACT=toolchain_${HOST}_${TARGET}
1071-
1072-
# Verify toolchain archive checksum
1073-
pushd ${ARTIFACT_ROOT}/${TOOLCHAIN_ARTIFACT}
1074-
md5sum --check md5.sum
1075-
sha256sum --check sha256.sum
1076-
popd
1077-
1078-
# Extract toolchain archive
1079-
${EXTRACT} ${ARTIFACT_ROOT}/${TOOLCHAIN_ARTIFACT}/${TOOLCHAIN_ARTIFACT}.${EXT}
1080-
done
1081-
10821064
# Stage host tools
10831065
HOSTTOOLS_ARTIFACT=hosttools_${HOST}
10841066
if [ -d ${ARTIFACT_ROOT}/${HOSTTOOLS_ARTIFACT} ]; then
@@ -1104,7 +1086,36 @@ jobs:
11041086
esac
11051087
popd
11061088
1107-
# Create distribution bundle archive
1089+
# Create minimal (without toolchains) distribution bundle archive
1090+
if [ "${{ matrix.host.archive }}" == "tar.gz" ]; then
1091+
${TAR} -zcvf ${ARCHIVE_NAME}_minimal.${EXT} --owner=0 --group=0 \
1092+
-C . ${ARCHIVE_DIR}
1093+
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
1094+
zip -r ${ARCHIVE_NAME}_minimal.${EXT} ${ARCHIVE_DIR}
1095+
fi
1096+
1097+
# Stage toolchains
1098+
pushd ${ARCHIVE_DIR}
1099+
1100+
## Generate target list from the workflow matrix
1101+
TARGETS=$(echo '${{ needs.setup.outputs.targets }}' | jq -cr '.[]')
1102+
1103+
## Extract all toolchains
1104+
for TARGET in ${TARGETS}; do
1105+
TOOLCHAIN_ARTIFACT=toolchain_${HOST}_${TARGET}
1106+
1107+
# Verify toolchain archive checksum
1108+
pushd ${ARTIFACT_ROOT}/${TOOLCHAIN_ARTIFACT}
1109+
md5sum --check md5.sum
1110+
sha256sum --check sha256.sum
1111+
popd
1112+
1113+
# Extract toolchain archive
1114+
${EXTRACT} ${ARTIFACT_ROOT}/${TOOLCHAIN_ARTIFACT}/${TOOLCHAIN_ARTIFACT}.${EXT}
1115+
done
1116+
popd
1117+
1118+
# Create full distribution bundle archive
11081119
if [ "${{ matrix.host.archive }}" == "tar.gz" ]; then
11091120
${TAR} -zcvf ${ARCHIVE_NAME}.${EXT} --owner=0 --group=0 \
11101121
-C . ${ARCHIVE_DIR}
@@ -1113,15 +1124,16 @@ jobs:
11131124
fi
11141125
11151126
# Compute checksum
1116-
md5sum ${ARCHIVE_NAME}.${EXT} > md5.sum
1117-
sha256sum ${ARCHIVE_NAME}.${EXT} > sha256.sum
1127+
md5sum ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_NAME}_minimal.${EXT} > md5.sum
1128+
sha256sum ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_NAME}_minimal.${EXT} > sha256.sum
11181129
11191130
- name: Upload distribution bundle
11201131
uses: actions/upload-artifact@v2
11211132
with:
11221133
name: ${{ env.BUNDLE_ARCHIVE_NAME }}
11231134
path: |
11241135
${{ env.BUNDLE_ARCHIVE_NAME }}.${{ matrix.host.archive }}
1136+
${{ env.BUNDLE_ARCHIVE_NAME }}_minimal.${{ matrix.host.archive }}
11251137
md5.sum
11261138
sha256.sum
11271139
@@ -1166,7 +1178,7 @@ jobs:
11661178
# Install required system packages
11671179
sudo apt-get update
11681180
sudo apt-get install -y ccache device-tree-compiler dos2unix gperf \
1169-
jq ninja-build
1181+
jq ninja-build wget
11701182
11711183
# Upgrade pip
11721184
python3 -m pip install --upgrade pip
@@ -1191,7 +1203,7 @@ jobs:
11911203
shopt -u dotglob
11921204
11931205
# Install required system packages
1194-
brew install ccache coreutils dos2unix dtc gperf jq ninja
1206+
brew install ccache coreutils dos2unix dtc gperf jq ninja wget
11951207
11961208
# Upgrade pip
11971209
sudo python3 -m pip install --upgrade pip
@@ -1215,7 +1227,7 @@ jobs:
12151227
shopt -u dotglob
12161228
12171229
# Install required system packages
1218-
choco install ccache dtc-msys2 gperf jq ninja
1230+
choco install ccache dtc-msys2 gperf jq ninja wget unzip
12191231
12201232
# Upgrade pip
12211233
python3 -m pip install --upgrade pip

0 commit comments

Comments
 (0)