Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

chore: centralize Go version configuration #1162

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
# NOTE(chrisgacsal): Use actions/cache for caching Go dependency and build caches
# as if provides better flexibility like setting the cache key which reduces cache misses significantly.
cache: false
go-version-file: 'api/types/go.mod'
go-version-file: '.go-version'

- name: Setup Go caching
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-api-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-api-${{ github.ref_name }}-
${{ runner.os }}-go-api-${{ github.event.repository.default_branch }}-
${{ runner.os }}-go-${{ github.ref_name }}-
${{ runner.os }}-go-${{ github.event.repository.default_branch }}-

- name: Generate API code
run: make gen-api
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
# NOTE(chrisgacsal): Use actions/cache for caching Go dependency and build caches
# as if provides better flexibility like setting the cache key which reduces cache misses significantly.
cache: false
go-version-file: 'go.mod'
go-version-file: '.go-version'

- name: Setup Go caching
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-end-to-end-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# NOTE(chrisgacsal): Use actions/cache for caching Go dependency and build caches
# as if provides better flexibility like setting the cache key which reduces cache misses significantly.
cache: false
go-version-file: 'e2e/go.mod'
go-version-file: '.go-version'

- name: Setup Go caching
uses: actions/cache@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# NOTE(chrisgacsal): Use actions/cache for caching Go dependency and build caches
# as if provides better flexibility like setting the cache key which reduces cache misses significantly.
cache: false
go-version-file: 'go.mod'
go-version-file: '.go-version'

- name: Setup Go caching
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
# NOTE(chrisgacsal): Use actions/cache for caching Go dependency and build caches
# as if provides better flexibility like setting the cache key which reduces cache misses significantly.
cache: false
go-version-file: 'go.mod'
go-version-file: '.go-version'

- name: Setup Go caching
uses: actions/cache@v4
Expand Down
1 change: 1 addition & 0 deletions .go-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.21.4
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ VERSION ?= $(shell git rev-parse --short HEAD)
DOCKER_REGISTRY ?= ghcr.io/openclarity
DOCKER_TAG ?= $(VERSION)
VMCLARITY_TOOLS_BASE ?=
GO_VERSION ?= 1.21.4
GO_VERSION ?= $(shell cat $(ROOT_DIR)/.go-version)

####
## Runtime variables
Expand Down
Loading