Skip to content

Hackathon: Platform Cluster provisioning #415

Hackathon: Platform Cluster provisioning

Hackathon: Platform Cluster provisioning #415

---
name: Integration Test
# yamllint disable-line rule:truthy
on:
push:
branches: ["main"]
paths:
- 'charts/**'
- '!charts/k8s-monitoring-v1/**'
pull_request:
paths:
- 'charts/**'
- '!charts/k8s-monitoring-v1/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
list-tests:
name: List tests
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.list_tests.outputs.tests }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: List tests
id: list_tests
run: |
tests=$(ls charts/k8s-monitoring/tests/integration)
echo "Tests: ${tests}"
echo "tests=$(echo "${tests}" | jq --raw-input --slurp --compact-output 'split("\n") | map(select(. != ""))')" >> "${GITHUB_OUTPUT}"
run-tests:
name: Integration Test
needs: list-tests
runs-on: ubuntu-latest
strategy:
matrix:
test: ${{ fromJson(needs.list-tests.outputs.tests) }}
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Setup Kind CLI
uses: helm/kind-action@v1
with:
install_only: true
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
- name: Run test
run: ./scripts/run-cluster-test.sh "charts/k8s-monitoring/tests/integration/${{ matrix.test }}"
env:
CREATE_CLUSTER: "true"
DELETE_CLUSTER: "true"