mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-09 12:28:13 -04:00
build: speed up CI pipeline
This commit is contained in:
parent
dda3b0273b
commit
7838b995b7
@ -158,7 +158,20 @@ if [[ "-$BUILD_TYPE-" == *-nostacktrace-* ]]; then
|
||||
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_STACKTRACE=0"
|
||||
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"
|
||||
|
||||
if [[ "-$BUILD_TYPE-" == *-shared-* ]]; then
|
||||
@ -188,7 +201,7 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
|
||||
*-full-*)
|
||||
cmake ../dwarfs/ $CMAKE_ARGS
|
||||
time $BUILD_TOOL
|
||||
ctest --output-on-failure -j$(nproc)
|
||||
$RUN_TESTS
|
||||
DESTDIR="$INSTALLDIR" $BUILD_TOOL install
|
||||
$BUILD_TOOL distclean
|
||||
;;
|
||||
@ -197,7 +210,7 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
|
||||
# ==== libdwarfs ====
|
||||
cmake ../dwarfs/ $CMAKE_ARGS -DWITH_LIBDWARFS=ON -DWITH_TOOLS=OFF -DWITH_FUSE_DRIVER=OFF
|
||||
time $BUILD_TOOL
|
||||
ctest --output-on-failure -j$(nproc)
|
||||
$RUN_TESTS
|
||||
DESTDIR="$INSTALLDIR" $BUILD_TOOL install
|
||||
$BUILD_TOOL distclean
|
||||
rm -rf *
|
||||
@ -205,7 +218,7 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
|
||||
# ==== dwarfs tools ====
|
||||
cmake ../dwarfs/ $CMAKE_ARGS -DWITH_LIBDWARFS=OFF -DWITH_TOOLS=ON -DWITH_FUSE_DRIVER=OFF -DCMAKE_PREFIX_PATH="$PREFIXPATH"
|
||||
time $BUILD_TOOL
|
||||
ctest --output-on-failure -j$(nproc)
|
||||
$RUN_TESTS
|
||||
DESTDIR="$INSTALLDIR" $BUILD_TOOL install
|
||||
$BUILD_TOOL distclean
|
||||
rm -rf *
|
||||
@ -213,7 +226,7 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
|
||||
# ==== dwarfs fuse driver ====
|
||||
cmake ../dwarfs/ $CMAKE_ARGS -DWITH_LIBDWARFS=OFF -DWITH_TOOLS=OFF -DWITH_FUSE_DRIVER=ON -DCMAKE_PREFIX_PATH="$PREFIXPATH"
|
||||
time $BUILD_TOOL
|
||||
ctest --output-on-failure -j$(nproc)
|
||||
$RUN_TESTS
|
||||
DESTDIR="$INSTALLDIR" $BUILD_TOOL install
|
||||
$BUILD_TOOL distclean
|
||||
;;
|
||||
@ -229,9 +242,7 @@ else
|
||||
|
||||
time $BUILD_TOOL
|
||||
|
||||
if [[ "-$BUILD_TYPE-" != *-source-* ]]; then
|
||||
ctest --output-on-failure -j$(nproc)
|
||||
fi
|
||||
$RUN_TESTS
|
||||
|
||||
if [[ "-$BUILD_TYPE-" == *-coverage-* ]]; then
|
||||
rm -f /tmp-runner/dwarfs-coverage.txt
|
||||
@ -271,7 +282,7 @@ else
|
||||
|
||||
time $BUILD_TOOL
|
||||
|
||||
ctest --output-on-failure -j$(nproc)
|
||||
$RUN_TESTS
|
||||
fi
|
||||
|
||||
$BUILD_TOOL strip
|
||||
@ -287,20 +298,6 @@ else
|
||||
cp artifacts.env /tmp-runner
|
||||
cp dwarfs-universal-* /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
|
||||
$BUILD_TOOL package_source
|
||||
$BUILD_TOOL copy_source_artifacts
|
||||
@ -309,7 +306,7 @@ else
|
||||
if [[ "-$BUILD_TYPE-" != *-[at]san-* ]] && \
|
||||
[[ "-$BUILD_TYPE-" != *-ubsan-* ]] && \
|
||||
[[ "-$BUILD_TYPE-" != *-source-* ]] && \
|
||||
( [[ "-$BUILD_TYPE-" != *-static-* ]] || [[ "$VERSION" != "" ]] ); then
|
||||
[[ "-$BUILD_TYPE-" != *-static-* ]]; then
|
||||
INSTALLDIR="$HOME/install"
|
||||
rm -rf "$INSTALLDIR"
|
||||
DESTDIR="$INSTALLDIR" $BUILD_TOOL install
|
||||
|
28
.github/workflows/build.yml
vendored
28
.github/workflows/build.yml
vendored
@ -56,7 +56,7 @@ jobs:
|
||||
shell: cmd
|
||||
run: |
|
||||
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
|
||||
shell: cmd
|
||||
@ -131,7 +131,7 @@ jobs:
|
||||
--mount type=bind,source=/home/mhx/github-ccache,target=/ccache \
|
||||
--mount type=bind,source=/home/mhx/github-local,target=/local \
|
||||
--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_DIST=arch \
|
||||
--env GITHUB_REF_NAME \
|
||||
@ -249,23 +249,11 @@ jobs:
|
||||
- fedora
|
||||
- arch
|
||||
build_type:
|
||||
- gcc-debug-shared-ninja
|
||||
- gcc-release-ninja
|
||||
- gcc-release-shared-ninja
|
||||
- clang-release-shared-ninja
|
||||
exclude:
|
||||
- arch: arm64v8
|
||||
dist: arch
|
||||
build_type: gcc-debug-shared-ninja
|
||||
- arch: arm64v8
|
||||
dist: arch
|
||||
build_type: gcc-release-ninja
|
||||
- arch: arm64v8
|
||||
dist: arch
|
||||
build_type: gcc-release-shared-ninja
|
||||
- arch: arm64v8
|
||||
dist: arch
|
||||
build_type: clang-release-shared-ninja
|
||||
include:
|
||||
- arch: amd64
|
||||
dist: ubuntu
|
||||
@ -420,7 +408,6 @@ jobs:
|
||||
matrix:
|
||||
arch:
|
||||
- ARM64
|
||||
- X64
|
||||
build_mode:
|
||||
- Release
|
||||
- Debug
|
||||
@ -429,6 +416,17 @@ jobs:
|
||||
cmake_args:
|
||||
- name: Benchmark
|
||||
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:
|
||||
- name: Unpack Source Tarball
|
||||
|
Loading…
x
Reference in New Issue
Block a user