From df7f6448221c6b7786b8f1f63200f79b604c067e Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Tue, 19 Jul 2022 11:27:06 +0300 Subject: [PATCH] Move things around in github yml file, for clarity. Also, this avoids building the list of test binaries in release mode. They are not included in the neon.tgz tarball in release mode. --- .github/workflows/build_and_test.yml | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 01920643ec..0186232e3e 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -145,24 +145,15 @@ jobs: cov_prefix=() fi + # FIXME: What's this for? + mkdir -p /tmp/neon/etc/ + + # Install target binaries + mkdir -p /tmp/neon/bin/ binaries=$( "${cov_prefix[@]}" cargo metadata --format-version=1 --no-deps | jq -r '.packages[].targets[] | select(.kind | index("bin")) | .name' ) - - test_exe_paths=$( - "${cov_prefix[@]}" cargo test --message-format=json --no-run | - jq -r '.executable | select(. != null)' - ) - - mkdir -p /tmp/neon/bin/ - mkdir -p /tmp/neon/test_bin/ - mkdir -p /tmp/neon/etc/ - - # Keep bloated coverage data files away from the rest of the artifact - mkdir -p /tmp/coverage/ - - # Install target binaries for bin in $binaries; do SRC=target/$BUILD_TYPE/$bin DST=/tmp/neon/bin/$bin @@ -171,9 +162,14 @@ jobs: # Install test executables and write list of all binaries (for code coverage) if [[ $BUILD_TYPE == "debug" ]]; then - for bin in $binaries; do - echo "/tmp/neon/bin/$bin" >> /tmp/coverage/binaries.list - done + # Keep bloated coverage data files away from the rest of the artifact + mkdir -p /tmp/coverage/ + + mkdir -p /tmp/neon/test_bin/ + test_exe_paths=$( + "${cov_prefix[@]}" cargo test --message-format=json --no-run | + jq -r '.executable | select(. != null)' + ) for bin in $test_exe_paths; do SRC=$bin DST=/tmp/neon/test_bin/$(basename $bin) @@ -183,6 +179,10 @@ jobs: strip "$SRC" -o "$DST" echo "$DST" >> /tmp/coverage/binaries.list done + + for bin in $binaries; do + echo "/tmp/neon/bin/$bin" >> /tmp/coverage/binaries.list + done fi - name: Prepare neon artifact