Skip to content

Commit

Permalink
Merge pull request #1550 from grafana/feat/e2e-matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
weisdd authored May 24, 2024
2 parents cad255b + 51eaf94 commit bfca452
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- id: changed-files
name: Get changed files
uses: tj-actions/changed-files@a29e8b565651ce417abb5db7164b4a2ad8b6155c #v44.4.0
Expand All @@ -29,56 +30,78 @@ jobs:
**/*.md
**/*.html
hugo/**
- id: which_files
name: Which files was changed
run: |
echo "One or more files has changed."
echo "List all the files that have changed: ${{ steps.changed-files.outputs.all_changed_files }}"
echo "What is any changed ${{ steps.changed-files.outputs.any_changed }}"
- id: docs_only_check
if: steps.changed-files.outputs.any_changed != 'true'
name: Check for docs-only changes
run: echo "docs_only=true" >> $GITHUB_OUTPUT

end-to-end:
e2e-tests:
name: e2e on kind ${{ matrix.version }}
runs-on: ubuntu-latest
needs:
- docs_only_check
if: (needs.docs_only_check.outputs.docs_only != 'true')
env:
KUBECONFIG: /home/runner/.kube/kind-grafana-operator-e2e
strategy:
matrix:
version:
- v1.27.13
- v1.28.9
- v1.29.4
- v1.30.0
steps:
- name: Clone repo and checkout
uses: actions/checkout@v4

- name: Install go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true

- name: Install ko
uses: ko-build/[email protected]
with:
version: v0.13.0

- name: Install chainsaw
uses: kyverno/[email protected]
- name: Create KinD cluster

- name: Create KinD cluster ${{ matrix.version }}
id: kind
run: |
kind --kubeconfig="${KUBECONFIG}" create cluster --image=kindest/node:v1.25.3 --config tests/e2e/kind.yaml
kind --kubeconfig="${KUBECONFIG}" create cluster --image=kindest/node:${{ matrix.version }} --config tests/e2e/kind.yaml
- name: Install kubectl
uses: azure/setup-kubectl@v4
with:
version: ${{ matrix.version }}

- name: Build and load images
env:
KO_DOCKER_REPO: ko.local/grafana/grafana-operator
run: |
set -e
ko build --sbom=none --bare
kind load docker-image "$KO_DOCKER_REPO"
- name: Run e2e tests
shell: bash
run: |
# install chainsaw
make chainsaw
# Run e2e
VERSION=latest make e2e
- name: Debug failure
if: failure()
run: |
Expand All @@ -92,3 +115,11 @@ jobs:
kubectl logs -n $NAMESPACE $POD -c manager
echo "previous pod logs (if any)"
kubectl logs -p -n $NAMESPACE $POD -c manager || true
end-to-end:
runs-on: ubuntu-latest
needs:
- e2e-tests
steps:
- run: |
echo "All E2E tests ran successfully"

0 comments on commit bfca452

Please sign in to comment.