Skip to content

Commit

Permalink
Merge pull request #400 from negz/bump-bump
Browse files Browse the repository at this point in the history
Bump GitHub workflows and build submodule
  • Loading branch information
turkenh authored Mar 22, 2023
2 parents c424c4a + 112e9ed commit caacf09
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 29 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:

env:
# Common versions
GO_VERSION: '1.19.5'
GOLANGCI_VERSION: 'v1.50.1'
GO_VERSION: '1.20.1'
GOLANGCI_VERSION: 'v1.51.1'

jobs:
check-diff:
Expand All @@ -30,17 +30,17 @@ jobs:

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(go env GOCACHE)"
run: echo "::set-output name=cache::$(make go.cachedir)"

- name: Cache the Go Build Cache
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ${{ steps.go.outputs.cache }}
key: ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-build-check-diff-

- name: Cache Go Dependencies
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
Expand Down Expand Up @@ -84,17 +84,17 @@ jobs:

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(go env GOCACHE)"
run: echo "::set-output name=cache::$(make go.cachedir)"

- name: Cache the Go Build Cache
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ${{ steps.go.outputs.cache }}
key: ${{ runner.os }}-build-lint-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-build-lint-

- name: Cache Go Dependencies
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
Expand All @@ -107,7 +107,7 @@ jobs:
# this action because it leaves 'annotations' (i.e. it comments on PRs to
# point out linter violations).
- name: Lint
uses: golangci/golangci-lint-action@07db5389c99593f11ad7b44463c2d4233066a9b1 # v3
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3
with:
version: ${{ env.GOLANGCI_VERSION }}
skip-cache: true # We do our own caching.
Expand All @@ -130,17 +130,17 @@ jobs:

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(go env GOCACHE)"
run: echo "::set-output name=cache::$(make go.cachedir)"

- name: Cache the Go Build Cache
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ${{ steps.go.outputs.cache }}
key: ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-build-check-diff-

- name: Cache Go Dependencies
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
Expand All @@ -150,12 +150,12 @@ jobs:
run: make vendor vendor.check

- name: Initialize CodeQL
uses: github/codeql-action/init@a34ca99b4610d924e04c68db79e503e1f79f9f02 # v2
uses: github/codeql-action/init@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@a34ca99b4610d924e04c68db79e503e1f79f9f02 # v2
uses: github/codeql-action/analyze@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2

unit-tests:
runs-on: ubuntu-20.04
Expand All @@ -178,17 +178,17 @@ jobs:

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(go env GOCACHE)"
run: echo "::set-output name=cache::$(make go.cachedir)"

- name: Cache the Go Build Cache
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ${{ steps.go.outputs.cache }}
key: ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-build-unit-tests-

- name: Cache Go Dependencies
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ NPROCS ?= 1
# to half the number of CPU cores.
GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 )))

GO_REQUIRED_VERSION = 1.19
GO_LDFLAGS += -X $(GO_PROJECT)/pkg/version.Version=$(VERSION)
GO_SUBDIRS += pkg apis
GO111MODULE = on
GOLANGCILINT_VERSION = 1.49.0
GOLANGCILINT_VERSION = 1.51.2
-include build/makelib/golang.mk

# ====================================================================================
Expand All @@ -52,6 +51,16 @@ fallthrough: submodules
@echo Initial setup complete. Running make again . . .
@make


# NOTE(hasheddan): the build submodule currently overrides XDG_CACHE_HOME in
# order to force the Helm 3 to use the .work/helm directory. This causes Go on
# Linux machines to use that directory as the build cache as well. We should
# adjust this behavior in the build submodule because it is also causing Linux
# users to duplicate their build cache, but for now we just make it easier to
# identify its location in CI so that we cache between builds.
go.cachedir:
@go env GOCACHE

# Generate a coverage report for cobertura applying exclusions on
# - generated file
cobertura:
Expand Down
2 changes: 1 addition & 1 deletion pkg/connection/fake/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (ss *SecretStore) DeleteKeyValues(ctx context.Context, s *store.Secret, do
}

// StoreConfig is a mock implementation of the StoreConfig interface.
type StoreConfig struct {
type StoreConfig struct { //nolint:musttag // This is a fake implementation to be used in unit tests only.
metav1.ObjectMeta

Config v1.SecretStoreConfig
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/providerconfig/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (

// This can't live in fake, because it would cause an import cycle due to
// GetItems returning managed.ProviderConfigUsage.
type ProviderConfigUsageList struct {
type ProviderConfigUsageList struct { //nolint:musttag // This is a fake implementation to be used in unit tests only.
client.ObjectList
Items []resource.ProviderConfigUsage
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/resource/fake/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (m *ManagedResourceReferencer) SetResourceReference(r *corev1.ObjectReferen
func (m *ManagedResourceReferencer) GetResourceReference() *corev1.ObjectReference { return m.Ref }

// ProviderReferencer is a mock that implements ProviderReferencer interface.
type ProviderReferencer struct{ Ref *xpv1.Reference }
type ProviderReferencer struct{ Ref *xpv1.Reference } //nolint:musttag // This is a fake implementation to be used in unit tests only.

// SetProviderReference sets the ProviderReference.
func (m *ProviderReferencer) SetProviderReference(p *xpv1.Reference) { m.Ref = p }
Expand All @@ -82,7 +82,7 @@ func (m *ProviderConfigReferencer) GetProviderConfigReference() *xpv1.Reference

// RequiredProviderConfigReferencer is a mock that implements the
// RequiredProviderConfigReferencer interface.
type RequiredProviderConfigReferencer struct{ Ref xpv1.Reference }
type RequiredProviderConfigReferencer struct{ Ref xpv1.Reference } //nolint:musttag // This is a fake implementation to be used in unit tests only.

// SetProviderConfigReference sets the ProviderConfigReference.
func (m *RequiredProviderConfigReferencer) SetProviderConfigReference(p xpv1.Reference) {
Expand Down Expand Up @@ -124,7 +124,7 @@ func (m *LocalConnectionSecretWriterTo) GetWriteConnectionSecretToReference() *x
}

// ConnectionSecretWriterTo is a mock that implements ConnectionSecretWriterTo interface.
type ConnectionSecretWriterTo struct{ Ref *xpv1.SecretReference }
type ConnectionSecretWriterTo struct{ Ref *xpv1.SecretReference } //nolint:musttag // This is a fake implementation to be used in unit tests only.

// SetWriteConnectionSecretToReference sets the WriteConnectionSecretToReference.
func (m *ConnectionSecretWriterTo) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) {
Expand Down Expand Up @@ -170,7 +170,7 @@ func (m *CompositionReferencer) SetCompositionReference(r *corev1.ObjectReferenc
func (m *CompositionReferencer) GetCompositionReference() *corev1.ObjectReference { return m.Ref }

// CompositionSelector is a mock that implements CompositionSelector interface.
type CompositionSelector struct{ Sel *metav1.LabelSelector }
type CompositionSelector struct{ Sel *metav1.LabelSelector } //nolint:musttag // This is a fake implementation to be used in unit tests only.

// SetCompositionSelector sets the CompositionSelector.
func (m *CompositionSelector) SetCompositionSelector(s *metav1.LabelSelector) { m.Sel = s }
Expand Down Expand Up @@ -284,7 +284,7 @@ func (c *ConnectionDetailsLastPublishedTimer) GetConnectionDetailsLastPublishedT

// UserCounter is a mock that satisfies UserCounter
// interface.
type UserCounter struct{ Users int64 }
type UserCounter struct{ Users int64 } //nolint:musttag // This is a fake implementation to be used in unit tests only.

// SetUsers sets the count of users.
func (m *UserCounter) SetUsers(i int64) {
Expand Down Expand Up @@ -482,7 +482,7 @@ func SchemeWith(o ...runtime.Object) *runtime.Scheme {

// MockConnectionSecretOwner is a mock object that satisfies ConnectionSecretOwner
// interface.
type MockConnectionSecretOwner struct {
type MockConnectionSecretOwner struct { //nolint:musttag // This is a fake implementation to be used in unit tests only.
runtime.Object
metav1.ObjectMeta

Expand Down Expand Up @@ -528,7 +528,7 @@ func (m *MockConnectionSecretOwner) DeepCopyObject() runtime.Object {

// MockLocalConnectionSecretOwner is a mock object that satisfies LocalConnectionSecretOwner
// interface.
type MockLocalConnectionSecretOwner struct {
type MockLocalConnectionSecretOwner struct { //nolint:musttag // This is a fake implementation to be used in unit tests only.
runtime.Object
metav1.ObjectMeta

Expand Down

0 comments on commit caacf09

Please sign in to comment.