diff --git a/ci/lint/04_install.sh b/ci/lint/01_install.sh similarity index 97% rename from ci/lint/04_install.sh rename to ci/lint/01_install.sh index c1e39dc93e2..a00d95da73a 100755 --- a/ci/lint/04_install.sh +++ b/ci/lint/01_install.sh @@ -6,6 +6,8 @@ export LC_ALL=C +set -o errexit -o pipefail -o xtrace + export CI_RETRY_EXE="/ci_retry --" pushd "/" diff --git a/ci/lint_imagefile b/ci/lint_imagefile index 9da3747e083..b32380769de 100644 --- a/ci/lint_imagefile +++ b/ci/lint_imagefile @@ -12,7 +12,7 @@ ENV LC_ALL=C.UTF-8 COPY ./ci/retry/retry /ci_retry COPY ./.python-version /.python-version COPY ./ci/lint/container-entrypoint.sh /entrypoint.sh -COPY ./ci/lint/04_install.sh /install.sh +COPY ./ci/lint/01_install.sh /install.sh RUN /install.sh && \ echo 'alias lint="./ci/lint/06_script.sh"' >> ~/.bashrc && \ diff --git a/ci/lint_run_all.sh b/ci/lint_run_all.sh index ab3f4392dcb..427e24e17fb 100755 --- a/ci/lint_run_all.sh +++ b/ci/lint_run_all.sh @@ -13,6 +13,6 @@ cp "./ci/retry/retry" "/ci_retry" cp "./.python-version" "/.python-version" mkdir --parents "/test/lint" cp --recursive "./test/lint/test_runner" "/test/lint/" -set -o errexit; source ./ci/lint/04_install.sh +set -o errexit; source ./ci/lint/01_install.sh set -o errexit ./ci/lint/06_script.sh diff --git a/ci/test/01_base_install.sh b/ci/test/01_base_install.sh index d61aaca3f0c..908133a9200 100755 --- a/ci/test/01_base_install.sh +++ b/ci/test/01_base_install.sh @@ -6,11 +6,11 @@ export LC_ALL=C.UTF-8 -set -ex +set -o errexit -o pipefail -o xtrace -CFG_DONE="ci.base-install-done" # Use a global git setting to remember whether this script ran to avoid running it twice +CFG_DONE="${BASE_ROOT_DIR}/ci.base-install-done" # Use a global setting to remember whether this script ran to avoid running it twice -if [ "$(git config --global ${CFG_DONE})" == "true" ]; then +if [ "$( cat "${CFG_DONE}" || true )" == "done" ]; then echo "Skip base install" exit 0 fi @@ -105,4 +105,4 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ] tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH" fi -git config --global ${CFG_DONE} "true" +echo -n "done" > "${CFG_DONE}" diff --git a/ci/test/02_run_container.sh b/ci/test/02_run_container.sh index 9616018e31e..33e250c3e53 100755 --- a/ci/test/02_run_container.sh +++ b/ci/test/02_run_container.sh @@ -153,13 +153,9 @@ CI_EXEC () { export -f CI_EXEC # Normalize all folders to BASE_ROOT_DIR -CI_EXEC rsync --archive --stats --human-readable "${BASE_READ_ONLY_DIR}/" "${BASE_ROOT_DIR}" || echo "Nothing to copy from ${BASE_READ_ONLY_DIR}/" +CI_EXEC rsync --recursive --perms --stats --human-readable "${BASE_READ_ONLY_DIR}/" "${BASE_ROOT_DIR}" || echo "Nothing to copy from ${BASE_READ_ONLY_DIR}/" CI_EXEC "${BASE_ROOT_DIR}/ci/test/01_base_install.sh" -# Fixes permission issues when there is a container UID/GID mismatch with the owner -# of the git source code directory. -CI_EXEC git config --global --add safe.directory \"*\" - CI_EXEC mkdir -p "${BINS_SCRATCH_DIR}" CI_EXEC "${BASE_ROOT_DIR}/ci/test/03_test_script.sh" diff --git a/test/lint/README.md b/test/lint/README.md index a0ae2132712..7c3798cdefd 100644 --- a/test/lint/README.md +++ b/test/lint/README.md @@ -54,7 +54,7 @@ or `--help`: | `py_lint` | [ruff](https://github.com/astral-sh/ruff) | markdown link check | [mlc](https://github.com/becheran/mlc) -In use versions and install instructions are available in the [CI setup](../../ci/lint/04_install.sh). +In use versions and install instructions are available in the [CI setup](../../ci/lint/01_install.sh). Please be aware that on Linux distributions all dependencies are usually available as packages, but could be outdated.