Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'


19 changes: 11 additions & 8 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 14 additions & 5 deletions scripts/ci_build_and_test_in_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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."
Expand Down