chore(operator): CI take advantage of setup-go cache (#16629)

pull/16754/head
Joao Marcal 2 months ago committed by GitHub
parent a04f0c66f4
commit 5b619b6d66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      .github/workflows/operator-bundle.yaml
  2. 11
      .github/workflows/operator-scorecard.yaml
  3. 56
      .github/workflows/operator.yaml
  4. 3
      operator/Makefile

@ -13,19 +13,12 @@ jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23']
steps:
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go
- uses: actions/checkout@v4
- name: Install make
run: sudo apt-get install make
go-version-file: ./operator/go.mod
- name: make bundle
run: |
make bundle-all && git diff --exit-code -I'^ createdAt: '

@ -13,22 +13,15 @@ jobs:
build:
name: scorecard
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23']
steps:
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go
go-version-file: ./operator/go.mod
- uses: engineerd/setup-kind@v0.5.0
with:
version: "v0.17.0"
- uses: actions/checkout@v4
- name: Install make
run: sudo apt-get install make
- name: Run scorecard
run: make scorecard
working-directory: ./operator

@ -13,19 +13,12 @@ jobs:
docs:
name: docs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23']
steps:
- name: Install make
run: sudo apt-get install make
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go
- uses: actions/checkout@v4
go-version-file: ./operator/go.mod
- name: Check generated docs
working-directory: ./operator
run: |
@ -35,19 +28,12 @@ jobs:
lint:
name: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23']
steps:
- name: Install make
run: sudo apt-get install make
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go
- uses: actions/checkout@v4
go-version-file: ./operator/go.mod
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
@ -61,19 +47,13 @@ jobs:
build-manager:
name: Build Manager
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23']
steps:
- name: Install make
run: sudo apt-get install make
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
go-version-file: ./operator/go.mod
id: go
- uses: actions/checkout@v4
- name: Build Manager
working-directory: ./operator
run: |-
@ -82,19 +62,12 @@ jobs:
build-broker:
name: Build Broker
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23']
steps:
- name: Install make
run: sudo apt-get install make
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go
- uses: actions/checkout@v4
go-version-file: ./operator/go.mod
- name: Build Broker
working-directory: ./operator
run: |-
@ -103,19 +76,12 @@ jobs:
test:
name: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23']
steps:
- name: Install make
run: sudo apt-get install make
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go
- uses: actions/checkout@v4
go-version-file: ./operator/go.mod
- name: Run tests
working-directory: ./operator
run: go test -coverprofile=profile.cov ./...
@ -127,5 +93,5 @@ jobs:
with:
working-directory: ./operator
path-to-profile: profile.cov
flag-name: Go-${{ matrix.go }}
flag-name: Go-1.23
shallow: true

@ -313,6 +313,7 @@ oci-push-calculator: ## Push the calculator image
$(OCI_RUNTIME) push $(CALCULATOR_IMG)
##@ Website
TYPES_TARGET := $(shell find api/loki -type f -iname "*_types.go")
docs/operator/api.md: $(TYPES_TARGET) $(GEN_CRD_API_REFERENCE_DOCS)
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir "github.com/grafana/loki/operator/api/loki/" -config "$(PWD)/config/docs/config.json" -template-dir "$(PWD)/config/docs/templates" -out-file "$(PWD)/$@"
@ -331,7 +332,7 @@ docs/operator/feature-gates.md: $(FEATURE_GATES_TARGET) $(GEN_CRD_API_REFERENCE_
sed -i 's/+newline/\n/' $@
.PHONY: web-pre
web-pre: docs/operator/api.md docs/operator/feature-gates.md
web-pre: docs/operator/api.md docs/operator/feature-gates.md ## Build the markdown API files of the loki-operator.dev website
@echo ">> preprocessing docs for website"
@git submodule update --init --recursive
cd $(WEBSITE_DIR)/themes/doks/ && npm install && rm -rf content

Loading…
Cancel
Save