summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-01-21 10:55:48 -0500
committerBen Gamari <ben@smart-cactus.org>2019-01-30 10:06:31 -0500
commitcfbd39bd405b4cedd3ee10a6d4a2bdd89b6e2e2d (patch)
tree8413da41e587f9685b9e77453f60cc5373bd17db /.gitlab-ci.yml
parentc1d9416f2672b8d844141c0393fe773676749777 (diff)
downloadhaskell-cfbd39bd405b4cedd3ee10a6d4a2bdd89b6e2e2d.tar.gz
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.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml24
1 files changed, 21 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 389906eeca..4a8cb62e3b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
+