Skip to content

Commit

Permalink
ci(tests): concurrency support
Browse files Browse the repository at this point in the history
  • Loading branch information
Serpentiel committed Feb 14, 2024
1 parent e5bbfed commit 847a6b6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
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

## 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

0 comments on commit 847a6b6

Please sign in to comment.