Commit cfbd39bd authored by Ben Gamari's avatar Ben Gamari 🐢

gitlab-ci: Use build cleanup logic on Darwin as well

We use the shell executor on Darwin as well as Windows.
See https://gitlab.com/gitlab-org/gitlab-runner/issues/3856.
parent c1d9416f
......@@ -408,8 +408,8 @@ validate-x86_64-windows:
- ghc.tar.xz
- junit.xml
# Note [Cleanup on Windows]
# ~~~~~~~~~~~~~~~~~~~~~~~~~
# Note [Cleaning up after shell executor]
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# As noted in [1], gitlab-runner's shell executor doesn't clean up its working
# directory after builds. Unfortunately, we are forced to use the shell executor
......@@ -419,7 +419,7 @@ validate-x86_64-windows:
#
# [1] https://gitlab.com/gitlab-org/gitlab-runner/issues/3856
# See Note [Cleanup on Windows]
# See Note [Cleanup after shell executor]
cleanup-windows:
stage: cleanup
tags:
......@@ -440,3 +440,21 @@ cleanup-windows:
- del %BUILD_DIR%\* /F /Q
- for /d %%p in (%BUILD_DIR%\*) do rd /Q /S "%%p"
- exit /b 0
# See Note [Cleanup after shell executor]
cleanup-darwin:
stage: cleanup
tags:
- x86_64-darwin
when: always
before_script:
- echo "Time to clean up"
script:
- echo "Let's go"
after_script:
- BUILD_DIR=$CI_PROJECT_DIR
- echo "Cleaning $BUILD_DIR"
- cd $HOME
- rm -Rf $BUILD_DIR/*
- exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment