From 53f36177c11a0218d0e77f427b77e2da6ae4a5e4 Mon Sep 17 00:00:00 2001 From: Gerald Morrison <67469729+morri-son@users.noreply.github.com> Date: Thu, 2 May 2024 16:07:31 +0200 Subject: [PATCH] add cleanup to action for self hosted runner (#760) ## Description Add action for cleanup of self-hosted runner --- .github/workflows/buildcomponents.yaml | 5 ++++- .github/workflows/components.yaml | 7 +++++++ .github/workflows/lint_and_test.yaml | 6 ++++++ .github/workflows/release.yaml | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildcomponents.yaml b/.github/workflows/buildcomponents.yaml index 98aa930a0f..6ecf024d72 100644 --- a/.github/workflows/buildcomponents.yaml +++ b/.github/workflows/buildcomponents.yaml @@ -24,6 +24,9 @@ jobs: packages: write repository-projects: read steps: + - name: Self Hosted Runner Post Job Cleanup Action + uses: TooMuch4U/actions-clean@v2.1 + - name: Checkout uses: actions/checkout@v4 with: @@ -63,4 +66,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: ocm.ctf - path: gen/ctf \ No newline at end of file + path: gen/ctf diff --git a/.github/workflows/components.yaml b/.github/workflows/components.yaml index 7f326a97a9..5e8b60e728 100644 --- a/.github/workflows/components.yaml +++ b/.github/workflows/components.yaml @@ -39,6 +39,7 @@ jobs: run: | cd components/ocmcli PATH=$PATH:$(go env GOPATH)/bin make ctf + build-helminstaller: name: Build HelmInstaller runs-on: large_runner @@ -65,6 +66,7 @@ jobs: run: | cd components/helminstaller PATH=$PATH:$(go env GOPATH)/bin make ctf + build-helmdemo: name: Build HelmDemo runs-on: large_runner @@ -91,6 +93,7 @@ jobs: run: | cd components/helmdemo PATH=$PATH:$(go env GOPATH)/bin make ctf + build-subchartsdemo: name: Build Helm SubChartsDemo runs-on: large_runner @@ -117,10 +120,14 @@ jobs: run: | cd components/subchartsdemo PATH=$PATH:$(go env GOPATH)/bin make ctf + build-ecrplugin: name: Build ECR Plugin runs-on: large_runner steps: + - name: Self Hosted Runner Post Job Cleanup Action + uses: TooMuch4U/actions-clean@v2.1 + - name: Checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/lint_and_test.yaml b/.github/workflows/lint_and_test.yaml index 3078c9bc29..6f243c0d2f 100644 --- a/.github/workflows/lint_and_test.yaml +++ b/.github/workflows/lint_and_test.yaml @@ -39,6 +39,7 @@ jobs: run: | PATH=$PATH:$(go env GOPATH)/bin make build PATH=$PATH:$(go env GOPATH)/bin make test + lint: name: Lint runs-on: large_runner @@ -71,10 +72,14 @@ jobs: - name: Lint run: | PATH=$PATH:$(go env GOPATH)/bin make check + generate: name: DeepCopy verification runs-on: large_runner steps: + - name: Self Hosted Runner Post Job Cleanup Action + uses: TooMuch4U/actions-clean@v2.1 + - name: Checkout uses: actions/checkout@v4 with: @@ -99,3 +104,4 @@ jobs: - name: Check for diff run: | git diff --exit-code --shortstat + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ee2bcd6b8c..0df1d1ad30 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -122,6 +122,8 @@ jobs: id-token: write packages: write steps: + - name: Self Hosted Runner Post Job Cleanup Action + uses: TooMuch4U/actions-clean@v2.1 - name: Generate token id: generate_token uses: tibdex/github-app-token@v2