Skip to content

Commit

Permalink
ci: Use 7z format for Windows build artifacts
Browse files Browse the repository at this point in the history
This commit updates the CI workflow to output .7z archives for the
Windows build artifacts.

The 7z format uses the LZMA compression algorithm, which offers
significantly improved data compression ratio.

The `-l` option is used such that symbolic links are stored as copies
of the linked files because Windows requires administrator privileges
to create symbolic links.

Note that 7z performs multi-threaded compression by default.

For more details, refer to the issue zephyrproject-rtos#567.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
  • Loading branch information
stephanosio committed Oct 5, 2022
1 parent d373fb6 commit 88b0bfa
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ jobs:
"name": "windows-x86_64",
"runner": "zephyr_runner",
"container": "ghcr.io/zephyrproject-rtos/sdk-build:v1.2.3",
"archive": "zip"
"archive": "7z"
},'
fi
Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
"runner": "windows-2019-8c",
"container": "",
"bundle-host": "windows-x86_64",
"bundle-archive": "zip"
"bundle-archive": "7z"
},'
fi
Expand Down Expand Up @@ -409,7 +409,7 @@ jobs:
sudo apt-get install -y autoconf automake bison flex gettext \
help2man libboost-dev libboost-regex-dev \
libncurses5-dev libtool-bin libtool-doc \
pkg-config texinfo zip
pkg-config texinfo p7zip
# Install dependencies for cross compilation
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
Expand Down Expand Up @@ -754,10 +754,9 @@ jobs:
XZ_OPT="-T0" \
${TAR} -Jcvf ${ARCHIVE_FILE} \
--owner=0 --group=0 -C ${OUTPUT_BASE}/${OUTPUT_DIR} ${{ matrix.target }}
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
pushd ${OUTPUT_BASE}/${OUTPUT_DIR}
zip -r ${GITHUB_WORKSPACE}/${ARCHIVE_FILE} \
${{ matrix.target }}
7z a -t7z -l ${GITHUB_WORKSPACE}/${ARCHIVE_FILE} ${{ matrix.target }}
popd
fi
Expand Down Expand Up @@ -981,7 +980,7 @@ jobs:
# Install common dependencies
sudo apt-get update
sudo apt-get install -y zip
sudo apt-get install -y p7zip
# Set environment variables
echo "TAR=tar" >> $GITHUB_ENV
Expand Down Expand Up @@ -1026,9 +1025,8 @@ jobs:
XZ_OPT="-T0" \
${TAR} -Jcvf ${ARCHIVE_FILE} --owner=0 --group=0 \
-C . cmake
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
zip -r ${ARCHIVE_FILE} \
cmake
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
7z a -t7z -l ${ARCHIVE_FILE} cmake
fi
# Compute checksum
Expand Down Expand Up @@ -1071,7 +1069,7 @@ jobs:
# Install common dependencies
sudo apt-get update
sudo apt-get install -y jq zip
sudo apt-get install -y jq p7zip
# Set environment variables
echo "TAR=tar" >> $GITHUB_ENV
Expand Down Expand Up @@ -1131,8 +1129,8 @@ jobs:
if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
EXTRACT="${TAR} -Jxvf"
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
EXTRACT="unzip"
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
EXTRACT="7z x -o."
fi
# Create bundle directory
Expand Down Expand Up @@ -1182,8 +1180,8 @@ jobs:
XZ_OPT="-T0" \
${TAR} -Jcvf ${ARCHIVE_NAME}_minimal.${EXT} --owner=0 --group=0 \
-C . ${ARCHIVE_DIR}
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
zip -r ${ARCHIVE_NAME}_minimal.${EXT} ${ARCHIVE_DIR}
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
7z a -t7z -l ${ARCHIVE_NAME}_minimal.${EXT} ${ARCHIVE_DIR}
fi
# Stage toolchains
Expand Down Expand Up @@ -1212,8 +1210,8 @@ jobs:
XZ_OPT="-T0" \
${TAR} -Jcvf ${ARCHIVE_NAME}.${EXT} --owner=0 --group=0 \
-C . ${ARCHIVE_DIR}
elif [ "${{ matrix.host.archive }}" == "zip" ]; then
zip -r ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_DIR}
elif [ "${{ matrix.host.archive }}" == "7z" ]; then
7z a -t7z -l ${ARCHIVE_NAME}.${EXT} ${ARCHIVE_DIR}
fi
# Compute checksum
Expand Down Expand Up @@ -1320,7 +1318,7 @@ jobs:
shopt -u dotglob
# Install required system packages
choco install ccache dtc-msys2 gperf jq ninja wget unzip
choco install ccache dtc-msys2 gperf jq ninja wget 7zip
# Upgrade pip
python3 -m pip install --upgrade pip
Expand Down Expand Up @@ -1377,8 +1375,8 @@ jobs:
BUNDLE_FILE=${BUNDLE_NAME}.${{ matrix.testenv.bundle-archive }}
if [ "${{ matrix.testenv.bundle-archive }}" == "tar.xz" ]; then
${TAR} -Jxvf ${ARTIFACT_ROOT}/${BUNDLE_FILE} -C tools
elif [ "${{ matrix.testenv.bundle-archive }}" == "zip" ]; then
unzip ${ARTIFACT_ROOT}/${BUNDLE_FILE} -d tools
elif [ "${{ matrix.testenv.bundle-archive }}" == "7z" ]; then
7z x -otools ${ARTIFACT_ROOT}/${BUNDLE_FILE}
fi
# Run setup script
Expand Down

0 comments on commit 88b0bfa

Please sign in to comment.