add cleanup to action for self hosted runner (#760) #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: component CTFs | |
on: | |
pull_request_target: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
workflow_call: | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
build-cli: | |
name: Build CLI | |
runs-on: large_runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
- name: CTF | |
run: | | |
cd components/ocmcli | |
PATH=$PATH:$(go env GOPATH)/bin make ctf | |
build-helminstaller: | |
name: Build HelmInstaller | |
runs-on: large_runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
- name: CTF | |
run: | | |
cd components/helminstaller | |
PATH=$PATH:$(go env GOPATH)/bin make ctf | |
build-helmdemo: | |
name: Build HelmDemo | |
runs-on: large_runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
- name: CTF | |
run: | | |
cd components/helmdemo | |
PATH=$PATH:$(go env GOPATH)/bin make ctf | |
build-subchartsdemo: | |
name: Build Helm SubChartsDemo | |
runs-on: large_runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
- name: CTF | |
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/[email protected] | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
- name: CTF | |
run: | | |
cd components/ecrplugin | |
PATH=$PATH:$(go env GOPATH)/bin make ctf |