]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
github: Force a fresh clone on all self-hosted runners 76/head
authorTom Hromatka <tom.hromatka@oracle.com>
Tue, 7 Dec 2021 16:36:51 +0000 (09:36 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 7 Dec 2021 16:38:32 +0000 (09:38 -0700)
The cgroup v2 job is being run on a self-hosted runner that
re-uses the workspace.  Delete the local workspace on all
self-hosted runners prior to cloning the repo.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
.github/workflows/continuous-integration.yml

index d43e0ebbd001d9831cd1bebde13044c7d755e68d..3586d02936f221996304ff0f62754fa9faf44f3d 100644 (file)
@@ -23,6 +23,17 @@ name: Continuous Integration
 on: ["push", "pull_request"]
 
 jobs:
+  # Thanks to github user @martyrs
+  # https://github.community/t/how-to-properly-clean-up-self-hosted-runners/128909/3
+  cleaner:
+    name: Delete Self-Hosted Runner Workspaces
+    runs-on: self-hosted
+    steps:
+      - name: Delete workspace path
+        run: |
+          echo "Cleaning up previous run"
+          rm -rf "${{ github.workspace }}"
+
   unittests:
     name: Unit Tests
     runs-on: ubuntu-latest
@@ -163,6 +174,7 @@ jobs:
 
   functionaltestsv2:
     name: Cgroup v2 Functional Tests
+    needs: [cleaner]
     runs-on: self-hosted
 
     steps: