build: speed up CI pipeline

This commit is contained in:
Marcus Holland-Moritz 2024-08-14 07:50:41 +02:00
parent dda3b0273b
commit 7838b995b7
2 changed files with 34 additions and 39 deletions

View File

@ -158,7 +158,20 @@ if [[ "-$BUILD_TYPE-" == *-nostacktrace-* ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_STACKTRACE=0" CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_STACKTRACE=0"
fi fi
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_TESTS=1 -DWITH_LEGACY_FUSE=1" if [[ "-$BUILD_TYPE-" == *-source-* ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DDWARFS_OPTIMIZE=0"
else
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_LEGACY_FUSE=1"
fi
if [[ "-$BUILD_TYPE-" == *-notest-* ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_TESTS=0"
RUN_TESTS="echo 'skipping tests'"
else
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_TESTS=1"
RUN_TESTS="ctest --output-on-failure -j$(nproc)"
fi
CMAKE_ARGS="${CMAKE_ARGS} -DDWARFS_ARTIFACTS_DIR=/artifacts" CMAKE_ARGS="${CMAKE_ARGS} -DDWARFS_ARTIFACTS_DIR=/artifacts"
if [[ "-$BUILD_TYPE-" == *-shared-* ]]; then if [[ "-$BUILD_TYPE-" == *-shared-* ]]; then
@ -188,7 +201,7 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
*-full-*) *-full-*)
cmake ../dwarfs/ $CMAKE_ARGS cmake ../dwarfs/ $CMAKE_ARGS
time $BUILD_TOOL time $BUILD_TOOL
ctest --output-on-failure -j$(nproc) $RUN_TESTS
DESTDIR="$INSTALLDIR" $BUILD_TOOL install DESTDIR="$INSTALLDIR" $BUILD_TOOL install
$BUILD_TOOL distclean $BUILD_TOOL distclean
;; ;;
@ -197,7 +210,7 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
# ==== libdwarfs ==== # ==== libdwarfs ====
cmake ../dwarfs/ $CMAKE_ARGS -DWITH_LIBDWARFS=ON -DWITH_TOOLS=OFF -DWITH_FUSE_DRIVER=OFF cmake ../dwarfs/ $CMAKE_ARGS -DWITH_LIBDWARFS=ON -DWITH_TOOLS=OFF -DWITH_FUSE_DRIVER=OFF
time $BUILD_TOOL time $BUILD_TOOL
ctest --output-on-failure -j$(nproc) $RUN_TESTS
DESTDIR="$INSTALLDIR" $BUILD_TOOL install DESTDIR="$INSTALLDIR" $BUILD_TOOL install
$BUILD_TOOL distclean $BUILD_TOOL distclean
rm -rf * rm -rf *
@ -205,7 +218,7 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
# ==== dwarfs tools ==== # ==== dwarfs tools ====
cmake ../dwarfs/ $CMAKE_ARGS -DWITH_LIBDWARFS=OFF -DWITH_TOOLS=ON -DWITH_FUSE_DRIVER=OFF -DCMAKE_PREFIX_PATH="$PREFIXPATH" cmake ../dwarfs/ $CMAKE_ARGS -DWITH_LIBDWARFS=OFF -DWITH_TOOLS=ON -DWITH_FUSE_DRIVER=OFF -DCMAKE_PREFIX_PATH="$PREFIXPATH"
time $BUILD_TOOL time $BUILD_TOOL
ctest --output-on-failure -j$(nproc) $RUN_TESTS
DESTDIR="$INSTALLDIR" $BUILD_TOOL install DESTDIR="$INSTALLDIR" $BUILD_TOOL install
$BUILD_TOOL distclean $BUILD_TOOL distclean
rm -rf * rm -rf *
@ -213,7 +226,7 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
# ==== dwarfs fuse driver ==== # ==== dwarfs fuse driver ====
cmake ../dwarfs/ $CMAKE_ARGS -DWITH_LIBDWARFS=OFF -DWITH_TOOLS=OFF -DWITH_FUSE_DRIVER=ON -DCMAKE_PREFIX_PATH="$PREFIXPATH" cmake ../dwarfs/ $CMAKE_ARGS -DWITH_LIBDWARFS=OFF -DWITH_TOOLS=OFF -DWITH_FUSE_DRIVER=ON -DCMAKE_PREFIX_PATH="$PREFIXPATH"
time $BUILD_TOOL time $BUILD_TOOL
ctest --output-on-failure -j$(nproc) $RUN_TESTS
DESTDIR="$INSTALLDIR" $BUILD_TOOL install DESTDIR="$INSTALLDIR" $BUILD_TOOL install
$BUILD_TOOL distclean $BUILD_TOOL distclean
;; ;;
@ -229,9 +242,7 @@ else
time $BUILD_TOOL time $BUILD_TOOL
if [[ "-$BUILD_TYPE-" != *-source-* ]]; then $RUN_TESTS
ctest --output-on-failure -j$(nproc)
fi
if [[ "-$BUILD_TYPE-" == *-coverage-* ]]; then if [[ "-$BUILD_TYPE-" == *-coverage-* ]]; then
rm -f /tmp-runner/dwarfs-coverage.txt rm -f /tmp-runner/dwarfs-coverage.txt
@ -271,7 +282,7 @@ else
time $BUILD_TOOL time $BUILD_TOOL
ctest --output-on-failure -j$(nproc) $RUN_TESTS
fi fi
$BUILD_TOOL strip $BUILD_TOOL strip
@ -287,20 +298,6 @@ else
cp artifacts.env /tmp-runner cp artifacts.env /tmp-runner
cp dwarfs-universal-* /tmp-runner/artifacts cp dwarfs-universal-* /tmp-runner/artifacts
cp dwarfs-*-Linux*.tar.zst /tmp-runner/artifacts cp dwarfs-*-Linux*.tar.zst /tmp-runner/artifacts
if [[ "$VERSION" != "" ]]; then
# also perform a non-static build based on the source tarball
$BUILD_TOOL distclean
unset LDFLAGS
# shellcheck disable=SC2086
cmake ../dwarfs/ $CMAKE_ARGS_NONSTATIC
time $BUILD_TOOL
ctest --output-on-failure -j$(nproc)
fi
elif [[ "-$BUILD_TYPE-" == *-source-* ]]; then elif [[ "-$BUILD_TYPE-" == *-source-* ]]; then
$BUILD_TOOL package_source $BUILD_TOOL package_source
$BUILD_TOOL copy_source_artifacts $BUILD_TOOL copy_source_artifacts
@ -309,7 +306,7 @@ else
if [[ "-$BUILD_TYPE-" != *-[at]san-* ]] && \ if [[ "-$BUILD_TYPE-" != *-[at]san-* ]] && \
[[ "-$BUILD_TYPE-" != *-ubsan-* ]] && \ [[ "-$BUILD_TYPE-" != *-ubsan-* ]] && \
[[ "-$BUILD_TYPE-" != *-source-* ]] && \ [[ "-$BUILD_TYPE-" != *-source-* ]] && \
( [[ "-$BUILD_TYPE-" != *-static-* ]] || [[ "$VERSION" != "" ]] ); then [[ "-$BUILD_TYPE-" != *-static-* ]]; then
INSTALLDIR="$HOME/install" INSTALLDIR="$HOME/install"
rm -rf "$INSTALLDIR" rm -rf "$INSTALLDIR"
DESTDIR="$INSTALLDIR" $BUILD_TOOL install DESTDIR="$INSTALLDIR" $BUILD_TOOL install

View File

@ -56,7 +56,7 @@ jobs:
shell: cmd shell: cmd
run: | run: |
copy "C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll" ${{ runner.temp }}\build copy "C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll" ${{ runner.temp }}\build
ctest --test-dir ${{ runner.temp }}\build --output-on-failure -j8 ctest --test-dir ${{ runner.temp }}\build --output-on-failure -j
- name: Build Package - name: Build Package
shell: cmd shell: cmd
@ -131,7 +131,7 @@ jobs:
--mount type=bind,source=/home/mhx/github-ccache,target=/ccache \ --mount type=bind,source=/home/mhx/github-ccache,target=/ccache \
--mount type=bind,source=/home/mhx/github-local,target=/local \ --mount type=bind,source=/home/mhx/github-local,target=/local \
--mount type=bind,source=/mnt/opensource/artifacts/dwarfs,target=/artifacts \ --mount type=bind,source=/mnt/opensource/artifacts/dwarfs,target=/artifacts \
--env BUILD_TYPE=clang-release-ninja-source \ --env BUILD_TYPE=clang-release-ninja-source-notest \
--env BUILD_ARCH=amd64 \ --env BUILD_ARCH=amd64 \
--env BUILD_DIST=arch \ --env BUILD_DIST=arch \
--env GITHUB_REF_NAME \ --env GITHUB_REF_NAME \
@ -249,23 +249,11 @@ jobs:
- fedora - fedora
- arch - arch
build_type: build_type:
- gcc-debug-shared-ninja
- gcc-release-ninja
- gcc-release-shared-ninja - gcc-release-shared-ninja
- clang-release-shared-ninja
exclude: exclude:
- arch: arm64v8
dist: arch
build_type: gcc-debug-shared-ninja
- arch: arm64v8
dist: arch
build_type: gcc-release-ninja
- arch: arm64v8 - arch: arm64v8
dist: arch dist: arch
build_type: gcc-release-shared-ninja build_type: gcc-release-shared-ninja
- arch: arm64v8
dist: arch
build_type: clang-release-shared-ninja
include: include:
- arch: amd64 - arch: amd64
dist: ubuntu dist: ubuntu
@ -420,7 +408,6 @@ jobs:
matrix: matrix:
arch: arch:
- ARM64 - ARM64
- X64
build_mode: build_mode:
- Release - Release
- Debug - Debug
@ -429,6 +416,17 @@ jobs:
cmake_args: cmake_args:
- name: Benchmark - name: Benchmark
cmake_args: -DWITH_BENCHMARKS=ON cmake_args: -DWITH_BENCHMARKS=ON
include:
- arch: X64
build_mode: Release
config:
- name: Normal
cmake_args:
- arch: X64
build_mode: Debug
config:
- name: Benchmark
cmake_args: -DWITH_BENCHMARKS=ON
steps: steps:
- name: Unpack Source Tarball - name: Unpack Source Tarball