Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(tests): concurrency support #638

Merged
merged 1 commit into from
Feb 16, 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
21 changes: 20 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@ on:
workflow_dispatch: {}

jobs:
setup_aiven_project_suffix:
runs-on: ubuntu-latest
outputs:
project_name_suffix: ${{ steps.selproj.outputs.project_name_suffix }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: make selproj

- id: selproj
run: echo "project_name_suffix=$(make -s ci-selproj | tr -d '\n')" >> $GITHUB_OUTPUT
env:
AIVEN_TOKEN: ${{ secrets.AIVEN_TOKEN }}
AIVEN_PROJECT_NAME_PREFIX: ${{ secrets.AIVEN_PROJECT_NAME_PREFIX }}

test:
needs: setup_aiven_project_suffix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -16,4 +34,5 @@ jobs:
- run: make test
env:
AIVEN_TOKEN: ${{ secrets.AIVEN_TOKEN }}
AIVEN_PROJECT_NAME: ${{ secrets.AIVEN_PROJECT_NAME }}
AIVEN_PROJECT_NAME: >-
${{ secrets.AIVEN_PROJECT_NAME_PREFIX }}${{ needs.setup_aiven_project_suffix.outputs.project_name_suffix }}
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,21 @@ serve-docs: ## Run live preview.
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
TOOLS_DIR := hack/tools
jeff-held-aiven marked this conversation as resolved.
Show resolved Hide resolved

## Tool Binaries
KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize-$(KUSTOMIZE_VERSION)
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen-$(CONTROLLER_TOOLS_VERSION)
ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
SELPROJ = $(LOCALBIN)/selproj-$(SELPROJ_VERSION)

## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.7
CONTROLLER_TOOLS_VERSION ?= v0.9.2
ENVTEST_VERSION ?= release-0.16
GOLANGCI_LINT_VERSION ?= v1.54.2
SELPROJ_VERSION ?= v0.1.0

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand All @@ -204,7 +205,15 @@ $(ENVTEST): $(LOCALBIN)
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,${GOLANGCI_LINT_VERSION})
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))

.PHONY: selproj ci-selproj
selproj: $(SELPROJ)
$(SELPROJ): $(LOCALBIN)
$(call go-install-tool,$(SELPROJ),github.com/aiven/go-utils/selproj,$(SELPROJ_VERSION))

ci-selproj: selproj
$(SELPROJ)

ENABLE_WEBHOOKS ?= true
CERT_MANAGER_TAG ?= v1.11.0
Expand Down
Loading