Skip to content

Commit

Permalink
ci(tests): run each test as a separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
byashimov committed Dec 19, 2023
1 parent 5cc56e2 commit df0bff9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,29 @@ on:
workflow_dispatch: {}

jobs:
list:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.list.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- id: list
run: echo "name=matrix::$(go test ./tests/... -list=. | grep Test | jq -cnR '[inputs | select(length>0)]')" >> $GITHUB_OUTPUT
test:
runs-on: ubuntu-latest
needs: list
strategy:
matrix:
k8s-version:
- 1.24.10
name: ${{ fromJson(needs.list.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make test
- run: make test -run="^${{ matrix.name }}$"
env:
AIVEN_TOKEN: ${{ secrets.AIVEN_TOKEN }}
AIVEN_PROJECT_NAME: ${{ secrets.AIVEN_PROJECT_NAME }}
ENVTEST_K8S_VERSION: ${{ matrix.k8s-version }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ endif
IMG ?= aivenoy/aiven-operator:${IMG_TAG}
IMG_TAG ?= $(shell git rev-parse HEAD)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.24.2
ENVTEST_K8S_VERSION ?= 1.24.10

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down

0 comments on commit df0bff9

Please sign in to comment.