diff --git a/.github/workflows/operator-bundle.yaml b/.github/workflows/operator-bundle.yaml index 47a0b07ca5585..682bc8b788614 100644 --- a/.github/workflows/operator-bundle.yaml +++ b/.github/workflows/operator-bundle.yaml @@ -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: ' diff --git a/.github/workflows/operator-scorecard.yaml b/.github/workflows/operator-scorecard.yaml index 15db08cb65afc..f66558f3fe213 100644 --- a/.github/workflows/operator-scorecard.yaml +++ b/.github/workflows/operator-scorecard.yaml @@ -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 diff --git a/.github/workflows/operator.yaml b/.github/workflows/operator.yaml index 1ebbc8ff72d70..983ea6bbd4018 100644 --- a/.github/workflows/operator.yaml +++ b/.github/workflows/operator.yaml @@ -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 diff --git a/operator/Makefile b/operator/Makefile index ddc475e0c136f..bf38ca1e55268 100644 --- a/operator/Makefile +++ b/operator/Makefile @@ -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