-
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.8 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Test
env:
SCRIPTS_DIR: ./.github/scripts
on:
push:
jobs:
validate-manifests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup yq
uses: fluxcd/pkg/actions/yq@main
- name: Setup kubeconform
uses: fluxcd/pkg/actions/kubeconform@main
- name: Setup kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Validate manifests
run: $SCRIPTS_DIR/validate-manifests.sh
e2e-test:
runs-on: ubuntu-latest
needs: validate-manifests
strategy:
matrix:
environment: [local] # Add more environments here when needed
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Flux
uses: fluxcd/flux2/action@main
- name: Extract branch name
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Setup Kubernetes
uses: AbsaOSS/k3d-action@v2.4.0
with:
cluster-name: cluster-ci
k3d-version: v5.5.2
args: >-
--config=$SCRIPTS_DIR/cluster-config/cluster-ci.yaml
- name: Install Flux
run: flux install
- name: Setup cluster reconciliation
run: $SCRIPTS_DIR/e2e-setup-cluster-reconciliation.sh ${{ github.event.repository.html_url }} ${{ steps.extract_branch.outputs.branch }} ${{ matrix.environment }} ${{ github.actor }} ${{ secrets.GITHUB_TOKEN }}
- name: Verify cluster reconciliation
run: $SCRIPTS_DIR/e2e-verify-cluster-reconciliation.sh
- name: Verify helm reconciliation
run: $SCRIPTS_DIR/e2e-verify-helm-reconciliation.sh
# Run e2e tests for apps here
# ...
- name: Debug failure
if: failure()
run: $SCRIPTS_DIR/e2e-debug-failure.sh