feat: make ginkgo tests as matrix #269
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Helm e2e tests | |
on: | |
push: | |
branches: | |
- master | |
- main | |
paths-ignore: | |
- 'docs/**' | |
- 'website/**' | |
- 'assets/**' | |
- 'backup/**' | |
- '*.md' | |
pull_request: | |
types: [opened, synchronize, ready_for_review, reopened] | |
paths-ignore: | |
- 'docs/**' | |
- 'website/**' | |
- 'assets/**' | |
- 'backup/**' | |
- '*.md' | |
jobs: | |
create-tests-list: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: matrix | |
run: | | |
script=$(./test/make_matrix_ginkgo.sh helm) | |
echo "matrix=${script}" >> $GITHUB_OUTPUT | |
verify-code: | |
runs-on: ubuntu-latest | |
needs: [create-tests-list] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up env vars | |
run: | | |
echo "GO111MODULE=on" >> $GITHUB_ENV | |
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV | |
echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV | |
echo "KIND_CLUSTER_NAME=$(sed -n 's/KIND_CLUSTER_NAME=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV | |
echo "GOPATH=/home/runner/go" >> $GITHUB_ENV | |
- name: Prepare go environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Ensure Golang runtime dependencies | |
run: make go-dependencies | |
- name: Verify code formatting | |
run: make verify | |
run-helm-tests: | |
runs-on: ubuntu-latest | |
needs: [create-tests-list, verify-code] | |
if: github.event.pull_request.draft == false | |
name: ${{ matrix.test }} | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.create-tests-list.outputs.matrix) }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Prepare go environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Ensure Golang runtime dependencies | |
run: make go-dependencies | |
- name: Kind setup | |
uses: helm/[email protected] | |
with: | |
cluster_name: ${{env.KIND_CLUSTER_NAME}} | |
config: kind-cluster.yaml | |
- name: Prepare environment for e2e | |
run: | | |
sudo apt-get update && sudo apt-get install -y socat | |
sudo mkdir -p $HOME/.kube | |
sudo chown -R $USER $HOME/.kube | |
- name: Jenkins Operator - Helm Chart tests | |
env: | |
TNAME: ${{ matrix.test }} | |
TFILE: ${{ matrix.file }} | |
TLINE: ${{ matrix.line }} | |
run: | | |
git reset --hard | |
make helm-lint | |
printf "\n \n > Running test: %s from file: $s line: %s\n" "${TNAME}" "${TFILE}" "${TLINE}" | |
make helm-e2e E2E_TEST_ARGS='-ginkgo.v -ginkgo.focus="${TNAME}"' |