mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-12 18:50:37 +00:00
fix: distinguish build matrix build type from Makefile's BUILD_TYPE
build-neon uses `make postgres-...`. The Makefile expects BUILD_TYPE to be debug or release. Before this PR, the build matrix's BUILD_TYPE would be just that. Now the build matrix's build type is something different than the Makefile's BUILD_TYPE. Make the difference explicit.
This commit is contained in:
21
.github/workflows/build_and_test.yml
vendored
21
.github/workflows/build_and_test.yml
vendored
@@ -139,9 +139,13 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [ debug, release, image ]
|
||||
build_type:
|
||||
- debug
|
||||
- release
|
||||
- image
|
||||
env:
|
||||
BUILD_TYPE: ${{ matrix.build_type }}
|
||||
# NB: BUILD_TYPE != MATRIX_BUILD_TYPE; the former is a Makefile variable
|
||||
MATRIX_BUILD_TYPE: ${{ matrix.build_type }}
|
||||
GIT_VERSION: ${{ github.sha }}
|
||||
|
||||
steps:
|
||||
@@ -181,18 +185,20 @@ jobs:
|
||||
# corresponding Cargo.toml files for their descriptions.
|
||||
- name: Set env variables
|
||||
run: |
|
||||
case "$BUILD_TYPE" in
|
||||
case "$MATRIX_BUILD_TYPE" in
|
||||
debug)
|
||||
cov_prefix="scripts/coverage --profraw-prefix=$GITHUB_JOB --dir=/tmp/coverage run"
|
||||
CARGO_FEATURES="--features testing"
|
||||
CARGO_FLAGS="--locked"
|
||||
TARGET_DIR_NAME="debug"
|
||||
BUILD_TYPE="debug"
|
||||
;;
|
||||
release)
|
||||
cov_prefix=""
|
||||
CARGO_FEATURES="--features testing"
|
||||
CARGO_FLAGS="--locked --release"
|
||||
TARGET_DIR_NAME="release"
|
||||
BUILD_TYPE="release"
|
||||
;;
|
||||
image)
|
||||
# Like we do in the Dockerfile built by the neon-image stage.
|
||||
@@ -202,9 +208,10 @@ jobs:
|
||||
CARGO_FEATURES=""
|
||||
CARGO_FLAGS="--locked --release"
|
||||
TARGET_DIR_NAME="release"
|
||||
BUILD_TYPE="release"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown BUILD_TYPE: $BUILD_TYPE"
|
||||
echo "Unknown MATRIX_BUILD_TYPE: $MATRIX_BUILD_TYPE"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -213,6 +220,8 @@ jobs:
|
||||
echo "CARGO_FLAGS=${CARGO_FLAGS}" >> $GITHUB_ENV
|
||||
echo "CARGO_HOME=${GITHUB_WORKSPACE}/.cargo" >> $GITHUB_ENV
|
||||
echo "TARGET_DIR_NAME=${TARGET_DIR_NAME}" >> $GITHUB_ENV
|
||||
echo "MATRIX_BUILD_TYPE=${MATRIX_BUILD_TYPE}" >> $GITHUB_ENV
|
||||
echo "BUILD_TYPE=${BUILD_TYPE}" >> $GITHUB_ENV
|
||||
|
||||
# Disabled for now
|
||||
# Don't include the ~/.cargo/registry/src directory. It contains just
|
||||
@@ -288,7 +297,7 @@ jobs:
|
||||
done
|
||||
|
||||
# Install test executables and write list of all binaries (for code coverage)
|
||||
if [[ $BUILD_TYPE == "debug" ]]; then
|
||||
if [[ $MATRIX_BUILD_TYPE == "debug" ]]; then
|
||||
# Keep bloated coverage data files away from the rest of the artifact
|
||||
mkdir -p /tmp/coverage/
|
||||
|
||||
@@ -313,7 +322,7 @@ jobs:
|
||||
done
|
||||
else
|
||||
if [ "$cov_prefix" != "" ]; then
|
||||
echo "expecting coverage prefix to be empty for all build types except debug, got BUILD_TYPE=$BUILD_TYPE"
|
||||
echo "expecting coverage prefix to be empty for all gh matrix build types except 'debug', got MATRIX_BUILD_TYPE=$MATRIX_BUILD_TYPE"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user