Skip to content

Commit

Permalink
fix broken CI (#303)
Browse files Browse the repository at this point in the history
Signed-off-by: Dejan Pejchev <[email protected]>
  • Loading branch information
dejanzele authored Jun 3, 2024
1 parent 6c2c7ed commit 096fc03
Show file tree
Hide file tree
Showing 34 changed files with 4,716 additions and 834 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-go-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
go-version:
description: "Version of Go. Default 1.21"
required: false
default: "1.21"
default: "1.22"
outputs:
go-version:
description: "The installed Go version"
Expand All @@ -21,7 +21,7 @@ runs:
using: "composite"
steps:
- id: setup-go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
check-latest: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- uses: goreleaser/goreleaser-action@v5
with:
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ concurrency:

jobs:
lint:
if: github.event_name == 'schedule' || github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id
uses: ./.github/workflows/lint.yml
test:
if: github.event_name == 'schedule' || github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id
uses: ./.github/workflows/test.yml
codeql:
if: github.event_name == 'schedule' || github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id
uses: ./.github/workflows/codeql.yml
build:
if: github.event_name == 'schedule' || github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id
uses: ./.github/workflows/build.yml
# Virtual job that can be configured as a required check before a PR can be merged.
all-required-checks-done:
Expand All @@ -38,12 +42,4 @@ jobs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
const results = ${{ toJSON(needs.*.result) }};
if (results.every(res => res === 'success')) {
core.info('All required checks succeeded');
} else {
core.setFailed('Some required checks failed');
}
- run: echo "All required checks done"
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
language: ['go']
go: [ '1.21' ]
go: [ '1.22' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- name: Setup Go
id: setup-go
uses: ./.github/actions/setup-go-cache
with:
go-version: '1.21'
cache: false
cache-prefix: go-lint

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: "latest"
only-new-issues: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: "Docker login"
uses: "docker/login-action@v2"
uses: "docker/login-action@v3"
with:
username: "${{ secrets.DOCKERHUB_USER }}"
password: "${{ secrets.DOCKERHUB_PASS }}"
Expand All @@ -82,7 +82,7 @@ jobs:
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: v1.21.1
version: v1.26.2
args: "-f ./.goreleaser.yaml release --clean"
env:
FULL_RELEASE: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: "Docker login"
uses: "docker/login-action@v2"
uses: "docker/login-action@v3"
with:
username: "${{ secrets.DOCKERHUB_USER }}"
password: "${{ secrets.DOCKERHUB_PASS }}"
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,6 @@ jobs:
- name: Run integration tests
run: make test-integration

kind-e2e-tests:
name: Kind e2e Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Go
id: setup-go
uses: ./.github/actions/setup-go-cache
with:
cache-prefix: kind-e2e-tests

- name: Run kind e2e tests
run: ./scripts/e2e-test.sh

go-mod-up-to-date:
name: Golang Mod Up To Date
runs-on: ubuntu-latest
Expand Down
8 changes: 2 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ issues:

output:
print-issued-lines: true
format: github-actions
sort-results: true

linters:
Expand All @@ -20,9 +19,6 @@ linters:
- staticcheck

linters-settings:
goimports:
local-prefixes: github.com/armadaproject/armada-operator
goimports:
local-prefixes: github.com/armadaproject/armada-operator

run:
skip-dirs:
- dev/helm-charts/pulsar-helm-chart
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ mock: mockgen ## Generate mock client for k8sclient
.PHONY: generate-helm-chart
generate-helm-chart: manifests kustomize helmify ## Generate Helm chart from Kustomize manifests
$(KUSTOMIZE) build config/default | $(HELMIFY) -crd-dir charts/armada-operator
./hack/fix-helmify.sh

generate-crd-ref-docs: crd-ref-docs ## Generate CRD reference documentation
$(CRD_REF_DOCS) crd-ref-docs --source-path=./api --config=./hack/crd-ref-docs-config.yaml --renderer=markdown --output-path=./dev/crd
Expand All @@ -92,12 +91,12 @@ vet: ## Run go vet against code.
go vet ./...

.PHONY: lint
lint: ## Run golangci-lint against code.
golangci-lint run
lint: golangci-lint ## Run golangci-lint against code.
$(GOLANGCI_LINT) run

.PHONY: lint-fix
lint-fix: ## Run golangci-lint against code and fix issues.
golangci-lint run --fix
lint-fix: golangci-lint ## Run golangci-lint against code and fix issues.
$(GOLANGCI_LINT) run --fix

##@ Tests

Expand Down Expand Up @@ -182,11 +181,11 @@ kind-all: kind-create-cluster kind-deploy ## Create a kind cluster and deploy th

.PHONY: kind-create-cluster
kind-create-cluster: kind ## Create a kind cluster using config from hack/kind-config.yaml.
kind create cluster --config hack/kind-config.yaml --name $(KIND_CLUSTER_NAME)
$(KIND) create cluster --config hack/kind-config.yaml --name $(KIND_CLUSTER_NAME)

.PHONY: kind-load-image
kind-load-image: docker-build ## Load Operator Docker image into kind cluster.
kind load docker-image --name $(KIND_CLUSTER_NAME) ${IMAGE_TAG}
$(KIND) load docker-image --name $(KIND_CLUSTER_NAME) ${IMAGE_TAG}

.PHONY: kind-deploy
kind-deploy: kind-load-image install install-cert-manager wait-for-cert-manager ## Deploy operator in a kind cluster after building & loading the image
Expand All @@ -195,7 +194,7 @@ kind-deploy: kind-load-image install install-cert-manager wait-for-cert-manager

.PHONY: kind-delete-cluster
kind-delete-cluster: ## Delete the local development cluster using kind.
kind delete cluster --name $(KIND_CLUSTER_NAME)
$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)

.PHONY: install
install: kustomize manifests ## Install Armada Operator CRDs.
Expand Down Expand Up @@ -313,6 +312,7 @@ KIND ?= $(LOCALBIN_TOOLING)/kind
HELMIFY ?= $(LOCALBIN_TOOLING)/helmify
GORELEASER ?= $(LOCALBIN_TOOLING)/goreleaser
CRD_REF_DOCS ?= $(LOCALBIN_TOOLING)/crd-ref-docs
GOLANGCI_LINT ?= $(LOCALBIN_TOOLING)/golangci-lint

KUSTOMIZE_VERSION ?= v5.4.2
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
Expand Down Expand Up @@ -368,6 +368,12 @@ crd-ref-docs: $(CRD_REF_DOCS) ## Download crd-ref-docs locally if necessary.
$(CRD_REF_DOCS): $(LOCALBIN_TOOLING)
test -s $(CRD_REF_DOCS) || GOBIN=$(LOCALBIN_TOOLING) go install github.com/elastic/crd-ref-docs@$(CRD_REF_DOCS_VERSION)

GOLANGCI_LINT_VERSION ?= v1.59.0
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN_TOOLING)
test -s $(GOLANGCI_LINT) || GOBIN=$(LOCALBIN_TOOLING) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)

.PHONY: helm
HELM = ./bin/helm
OS=$(shell go env GOOS)
Expand Down
Loading

0 comments on commit 096fc03

Please sign in to comment.