From cec40d360868477174c32af254c133cbf441eea2 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Mon, 29 Dec 2025 00:24:58 -0800 Subject: [PATCH 1/5] force removal of files created from the CI runner --- .github/workflows/build_and_test.yml | 14 ++++++++------ scripts/ci_build_and_test_in_container.sh | 19 ++++++++++++++----- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f7805e9f0e4..a68e3fcfa11 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -369,10 +369,12 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: 'Cleanup build folder' + if: always() run: | - pwd - echo "cleaning ${GITHUB_WORKSPACE}" - ls -la ./ - rm -rf ./* ./.*|| true - echo "expecting ${GITHUB_WORKSPACE} to be empty" - ls -la ./ + set -euxo pipefail + docker run --rm \ + -v "${GITHUB_WORKSPACE}:/tmp/geos" \ + alpine:3.20 \ + sh -lc 'rm -rf /tmp/geos/* /tmp/geos/.[!.]* /tmp/geos/..?* || true' + + diff --git a/scripts/ci_build_and_test_in_container.sh b/scripts/ci_build_and_test_in_container.sh index 2fea08d275f..3fd609dc476 100755 --- a/scripts/ci_build_and_test_in_container.sh +++ b/scripts/ci_build_and_test_in_container.sh @@ -152,6 +152,19 @@ if [[ -z "${GEOS_SRC_DIR}" ]]; then exit 1 fi + +cleanup() { + echo "Container cleanup..." + rm -rf "${GEOS_SRC_DIR}/src/docs/sphinx/datastructure" || true + + if [[ -n "${HOST_UID:-}" && -n "${HOST_GID:-}" ]]; then + chown -R "${HOST_UID}:${HOST_GID}" "${GEOS_SRC_DIR}" || true + fi +} +trap cleanup EXIT + + + if [[ -z "${GEOS_DIR}" ]]; then echo "Installation folder undefined. Set to default value '/dev/null'. You can define it using '--install-dir-basename'." GEOS_DIR=/dev/null @@ -207,7 +220,7 @@ echo "Using ${NPROC} cores." if [[ "${RUN_INTEGRATED_TESTS}" = true ]]; then echo "Running the integrated tests has been requested." # We install the python environment required by ATS to run the integrated tests. - or_die apt-get update + #or_die apt-get update or_die apt-get install -y virtualenv python3-dev python-is-python3 ATS_PYTHON_HOME=/tmp/run_integrated_tests_virtualenv or_die virtualenv ${ATS_PYTHON_HOME} @@ -369,10 +382,6 @@ or_die cmake --build . --target clean or_die cd ${GEOS_SRC_DIR}/inputFiles find . -name *.pyc | xargs rm -f -# Clean the rst files -echo "Cleaning the rst files..." -or_die rm -rf ${GEOS_SRC_DIR}/src/docs/sphinx/datastructure - # If we're here, either everything went OK or we have to deal with the integrated tests manually. if [[ ! -z "${INTEGRATED_TEST_EXIT_STATUS+x}" ]]; then echo "Exiting the build process with exit status ${INTEGRATED_TEST_EXIT_STATUS} from the integrated tests." From 070380c1f7b3e0d95f42b95b309a42a4d61137b7 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Mon, 29 Dec 2025 00:42:10 -0800 Subject: [PATCH 2/5] Remove redundant cleanup command in workflow --- .github/workflows/build_and_test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index a68e3fcfa11..b1b1a0591c7 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -376,5 +376,3 @@ jobs: -v "${GITHUB_WORKSPACE}:/tmp/geos" \ alpine:3.20 \ sh -lc 'rm -rf /tmp/geos/* /tmp/geos/.[!.]* /tmp/geos/..?* || true' - - From 659cee1722d565de67348d01b99d6d7c65aeba39 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Mon, 29 Dec 2025 00:50:07 -0800 Subject: [PATCH 3/5] revert --- .github/workflows/build_and_test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index b1b1a0591c7..f7805e9f0e4 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -369,10 +369,10 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: 'Cleanup build folder' - if: always() run: | - set -euxo pipefail - docker run --rm \ - -v "${GITHUB_WORKSPACE}:/tmp/geos" \ - alpine:3.20 \ - sh -lc 'rm -rf /tmp/geos/* /tmp/geos/.[!.]* /tmp/geos/..?* || true' + pwd + echo "cleaning ${GITHUB_WORKSPACE}" + ls -la ./ + rm -rf ./* ./.*|| true + echo "expecting ${GITHUB_WORKSPACE} to be empty" + ls -la ./ From 80e87e40fcc67de3c302d704953bbd9750ff4357 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Mon, 29 Dec 2025 00:58:50 -0800 Subject: [PATCH 4/5] try to fix draft PR check --- .github/workflows/ci_tests.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 08bdcaa0f9c..622294f4bbf 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -54,18 +54,21 @@ jobs: steps: - name: Check that the PR is not a draft (cancel rest of jobs otherwise) id: extract_pr_info + env: + GITHUB_TOKEN: ${{ github.token }} run: | - if [[ ${{github.event_name}} == 'pull_request' ]]; then - # We do not rely on the `github.event.pull_request.labels` information since it's cached at the job. - # Changing labels or assignee in the PR would not allow to simply re-run the job with a different outcome. - pr_json=$(curl -H "Accept: application/vnd.github+json" https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}) - - # We stop the workflow if the pr is draft - draft_status=$(echo ${pr_json} | jq '.draft') + set -euo pipefail + + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + draft_status=$( curl -fsSL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${GITHUB_TOKEN}" "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}" | jq -r '.draft') + echo "Draft status of PR is ${draft_status}." - if [[ $draft_status == true ]]; then exit 1 ; fi + if [[ "${draft_status}" == "true" ]]; then + exit 1 + fi fi + # The TPL tag is contained in the codespaces configuration to avoid duplications. - name: Checkout .devcontainer/devcontainer.json From 0fac37ef9bccdcf401c44380668d62ff4dd37776 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Mon, 29 Dec 2025 01:01:46 -0800 Subject: [PATCH 5/5] try again --- .github/workflows/build_and_test.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f7805e9f0e4..a68e3fcfa11 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -369,10 +369,12 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: 'Cleanup build folder' + if: always() run: | - pwd - echo "cleaning ${GITHUB_WORKSPACE}" - ls -la ./ - rm -rf ./* ./.*|| true - echo "expecting ${GITHUB_WORKSPACE} to be empty" - ls -la ./ + set -euxo pipefail + docker run --rm \ + -v "${GITHUB_WORKSPACE}:/tmp/geos" \ + alpine:3.20 \ + sh -lc 'rm -rf /tmp/geos/* /tmp/geos/.[!.]* /tmp/geos/..?* || true' + +