-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 3.08 KB
/
e2e-tests.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: E2E Tests
# Trigger the workflow on pull requests and direct pushes to any branch
on:
push:
pull_request:
jobs:
test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
- name: Install Helm and Kubectl
if: matrix.os == 'macos-latest'
run: |
brew install helm
brew install kubectl
- name: Setup Minikube cluster
if: matrix.os != 'macos-latest'
uses: medyagh/setup-minikube@latest
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
- name: Remove pre-installed kustomize
if: matrix.os != 'macos-latest'
run: sudo rm -f /usr/local/bin/kustomize
- name: Perform the E2E test
if: matrix.os != 'macos-latest'
run: |
chmod -R +x scripts
export "GITHUB_PRIVATE_KEY=${{ secrets.GH_TEST_APP_PK }}"
export "GH_APP_ID=${{ secrets.GH_APP_ID }}"
export "GH_INSTALL_ID=${{ secrets.GH_INSTALL_ID }}"
export "VAULT_ADDR=http://vault.default:8200"
export "VAULT_ROLE_AUDIENCE=githubapp"
export "VAULT_ROLE=githubapp"
eval $(minikube docker-env)
# Run tests
make test-e2e || true
# debug
#docker images
#kubectl -n github-app-operator-system describe po
#kubectl -n github-app-operator-system describe deploy
#echo 'kubectl get mutatingwebhookconfiguration cert-manager-webhook -o jsonpath={.webhooks[*].clientConfig.caBundle}'
#kubectl get mutatingwebhookconfiguration cert-manager-webhook -o jsonpath={.webhooks[*].clientConfig.caBundle}
#kubectl -n cert-manager describe deploy,po
#echo "######### gh operator logs ##########"
#kubectl -n github-app-operator-system logs deploy/github-app-operator-controller-manager
#echo "######### cert-manager-webhook logs ##########"
#kubectl -n cert-manager logs deploy/cert-manager-webhook
- name: Report failure
uses: nashmaniac/[email protected]
# Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
title: 🐛 Unit tests failed on ${{ matrix.os }} for ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: kind/bug
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}