mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-07 18:43:26 -08:00
[CI] Resolve the coverage source root before the build dir cd
The previous commit computed SRC_ROOT after `cd "$BUILD_DIR"`, under a comment claiming it ran before. `$0` is relative to the directory the script was invoked from, so from inside the build dir `dirname "$0"` no longer resolves and the subshell's `cd` fails. Under `set -e` that is fatal rather than an empty variable, which took down every leg in the matrix, coverage or not, including the ones this change does not otherwise touch. Move it above the cd and guard it on MAKE_COVERAGE, since the coverage report is the only consumer. Resolving it unconditionally meant a coverage-only detail was paid for by every build in the fleet, and gave every one of them a way to fail.
This commit is contained in:
parent
2c249438d5
commit
2425c868a3
1 changed files with 9 additions and 4 deletions
|
|
@ -142,11 +142,16 @@ if [[ ! $BUILD_DIR ]]; then
|
||||||
BUILD_DIR="build"
|
BUILD_DIR="build"
|
||||||
fi
|
fi
|
||||||
mkdir -p "$BUILD_DIR"
|
mkdir -p "$BUILD_DIR"
|
||||||
cd "$BUILD_DIR"
|
|
||||||
|
|
||||||
# Captured before the cd because $0 is relative to the directory the script was invoked from,
|
if [[ $MAKE_COVERAGE ]]; then
|
||||||
# and after the cd it no longer resolves to anything. The coverage report needs the source root.
|
# Resolved while the working directory is still the source root. $0 is relative to the
|
||||||
SRC_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
# directory the script was invoked from, so after the cd below it no longer resolves, and
|
||||||
|
# under `set -e` the failed subshell would abort the build rather than just yielding an empty
|
||||||
|
# variable. Only the coverage report needs this, so only coverage pays for it.
|
||||||
|
SRC_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$BUILD_DIR"
|
||||||
|
|
||||||
# Set minimum CMake Version
|
# Set minimum CMake Version
|
||||||
export CMAKE_POLICY_VERSION_MINIMUM=3.10
|
export CMAKE_POLICY_VERSION_MINIMUM=3.10
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue