Skip to content

Commit

Permalink
Merge pull request #282 from vprashar2929/cache-tools
Browse files Browse the repository at this point in the history
feat(ci): add support to cache tools in CI
  • Loading branch information
sthaha authored Oct 18, 2023
2 parents f9455e6 + 6f42fbf commit 672efdf
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/publish-images/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ runs:
username: ${{ inputs.registry_login }}
password: ${{ inputs.registry_token }}

- name: Install all tools
uses: ./.github/tools-cache

- name: Build Operator
shell: bash
run: |
Expand Down
21 changes: 21 additions & 0 deletions .github/tools-cache/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: tools-cache
description: Caches development tools
runs:
using: composite
steps:
- uses: actions/cache@v3
id: tools-cache
with:
path: ./tmp/bin
key: ${{ runner.os }}-tools-${{ hashFiles('./hack/tools.sh') }}

- name: Install Dependencies
if: steps.tools-cache.outputs.cache-hit != 'true'
shell: bash
run: make tools

- name: Show version info of tools
shell: bash
run: |
ls ./tmp/bin
9 changes: 8 additions & 1 deletion .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ jobs:
- uses: actions/setup-go@main
with:
go-version-file: go.mod
- name: Install all tools
uses: ./.github/tools-cache

- name: bundle
run: |
make generate manifests bundle
Expand All @@ -101,6 +104,9 @@ jobs:
run: |
echo "result=$(git rev-parse --short HEAD),v1alpha1" >> $GITHUB_OUTPUT
- name: Install all tools
uses: ./.github/tools-cache

- name: build images for PR checks
uses: ./.github/publish-images
with:
Expand Down Expand Up @@ -128,7 +134,8 @@ jobs:
go-version-file: go.mod

- name: Install all tools
run: make tools
uses: ./.github/tools-cache

- name: use kepler action for kind cluster build
uses: sustainable-computing-io/kepler-action@v0.0.2
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
env:
VERSION: ${{ github.event.inputs.tag }}

- name: Install all tools
uses: ./.github/tools-cache

- name: Build Operator
run: |
make operator-build
Expand Down

0 comments on commit 672efdf

Please sign in to comment.