Add validation webhook #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |