Skip to content

Workflow file for this run

name: End-to-end test
on:
workflow_dispatch:
push:
branches: 'main'
pull_request:
branches: 'main'
jobs:
end-to-end-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Flux
uses: fluxcd/flux2/action@main
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Setup Kubernetes
uses: nolar/setup-k3d-k3s@v1
with:
k3d-name: cluster-test
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Flux
run: |
flux install
- name: Setup cluster reconciliation
run: |
flux create source git flux-system \
--url=${{ github.event.repository.html_url }} \
--branch=${{ steps.extract_branch.outputs.branch }} \
--ignore-paths="./k8s/clusters/development/flux-system/" \
--ignore-paths="./k8s/clusters/production/flux-system/"
flux create kustomization flux-system \
--source=flux-system \
--path=./k8s/clusters/development
- name: Verify cluster reconciliation
run: |
kubectl -n flux-system wait kustomization/infra-controllers --for=condition=ready --timeout=5m
kubectl -n flux-system wait kustomization/apps --for=condition=ready --timeout=5m
- name: Verify helm reconciliation
run: |
kubectl -n ingress-traefik wait helmrelease/ingress-traefik --for=condition=ready --timeout=5m
- name: Debug failure
if: failure()
run: |
kubectl -n flux-system get all
kubectl -n flux-system logs deploy/source-controller
kubectl -n flux-system logs deploy/kustomize-controller
kubectl -n flux-system logs deploy/helm-controller
flux get all --all-namespaces