From d6dae0be9f4d195f986a3ed6adbbdbb41a659a91 Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Tue, 7 Dec 2021 09:36:51 -0700 Subject: [PATCH] github: Force a fresh clone on all self-hosted runners 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 --- .github/workflows/continuous-integration.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d43e0ebb..3586d029 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -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: -- 2.47.2