Skip to content

Commit

Permalink
chore: test workflow_run
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-silva authored May 17, 2024
1 parent 1d7e190 commit 9e1bfb9
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 16 deletions.
146 changes: 146 additions & 0 deletions .github/workflows/dev-fe-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: FE E2E Workflow

on:
workflow_run:
workflows: ["FE CI Gatekeeper"]
types:
- completed

jobs:
e2e:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
ref: ${{ github.event.pull_request.head.sha }}
- uses: pnpm/action-setup@v3
with:
version: 8

- name: Use Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Set up Helm
uses: azure/setup-helm@v4

- name: Set up Go release
uses: percona-platform/setup-go@v4
with:
go-version: 1.22.x

- name: Set GO_VERSION environment variable
shell: bash
run: |
go version
echo "GO_VERSION=$(go version)" >> $GITHUB_ENV
- name: Create KIND cluster
uses: helm/[email protected]

- name: Add Helm Percona repository
shell: bash
run: |
helm repo add percona https://percona.github.io/percona-helm-charts/
- name: Install Helm PMM chart
shell: bash
run: |
helm install pmm --set secret.pmm_password='admin',service.type=ClusterIP percona/pmm
- name: Echo PMM credentials
shell: bash
run: |
url=$(kubectl get svc/monitoring-service -o json | jq -r '.spec.clusterIP')
echo -n "MONITORING_URL=http://$url" >> $GITHUB_ENV
- name: Run Provisioning
shell: bash
run: |
make build-cli
./bin/everestctl install -v \
--version 0.0.0 \
--version-metadata-url https://check-dev.percona.com \
--operator.mongodb \
--operator.postgresql \
--operator.xtradb-cluster \
--skip-wizard \
--namespaces everest-ui
- name: Adding psmdb namespace
shell: bash
run: |
./bin/everestctl install -v \
--version 0.0.0 \
--version-metadata-url https://check-dev.percona.com \
--operator.mongodb \
--operator.postgresql=false \
--operator.xtradb-cluster=false \
--skip-wizard \
--namespaces psmdb-only
- name: Adding pxc namespace
shell: bash
run: |
./bin/everestctl install -v \
--version 0.0.0 \
--version-metadata-url https://check-dev.percona.com \
--operator.mongodb=false \
--operator.postgresql=false \
--operator.xtradb-cluster \
--skip-wizard \
--namespaces pxc-only
- name: Adding pg namespace
shell: bash
run: |
./bin/everestctl install -v \
--version 0.0.0 \
--version-metadata-url https://check-dev.percona.com \
--operator.mongodb=false \
--operator.postgresql \
--operator.xtradb-cluster=false \
--skip-wizard \
--namespaces pg-only
- name: Change token
shell: bash
run: |
echo "EVEREST_K8_TOKEN=$(./bin/everestctl token reset --json | jq .token -r)" >> $GITHUB_ENV
- name: Expose Everest API Server
shell: bash
run: |
kubectl port-forward -n everest-system deployment/percona-everest 8080:8080 &
- name: Run Everest
shell: bash
run: |
cd ui
make init
pnpm --filter "@percona/everest" dev &
- name: Install Chromium for Playwright
shell: bash
run: |
cd ui/apps/everest
npx playwright install chromium
- name: Run integration tests
shell: bash
env:
EVEREST_LOCATION_BUCKET_NAME: '${{ secrets.BACKUP_LOCATION_BUCKET_NAME }}'
EVEREST_LOCATION_ACCESS_KEY: '${{ secrets.BACKUP_LOCATION_ACCESS_KEY }}'
EVEREST_LOCATION_SECRET_KEY: '${{ secrets.BACKUP_LOCATION_SECRET_KEY }}'
EVEREST_LOCATION_REGION: '${{ secrets.BACKUP_LOCATION_REGION }}'
EVEREST_LOCATION_URL: '${{ secrets.BACKUP_LOCATION_URL }}'
MONITORING_USER: 'admin'
MONITORING_PASSWORD: 'admin'
run: |
cd ui
pnpm --filter "@percona/everest" e2e
32 changes: 16 additions & 16 deletions .github/workflows/dev-fe-gatekeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,24 +122,24 @@ jobs:
echo "${{ github.triggering_actor }} does not have permissions on this repo."
exit 1
e2e_execution:
needs: permission_checks
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
lfs: true
ref: ${{ github.event.pull_request.head.sha }}
- uses: ./.github/actions/fe-e2e
with:
BACKUP_LOCATION_BUCKET_NAME: ${{ secrets.BACKUP_LOCATION_BUCKET_NAME }}
BACKUP_LOCATION_ACCESS_KEY: ${{ secrets.BACKUP_LOCATION_ACCESS_KEY }}
BACKUP_LOCATION_SECRET_KEY: ${{ secrets.BACKUP_LOCATION_SECRET_KEY }}
BACKUP_LOCATION_REGION: ${{ secrets.BACKUP_LOCATION_REGION }}
BACKUP_LOCATION_URL: ${{ secrets.BACKUP_LOCATION_URL }}
# e2e_execution:
# needs: permission_checks
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v4
# with:
# lfs: true
# ref: ${{ github.event.pull_request.head.sha }}
# - uses: ./.github/actions/fe-e2e
# with:
# BACKUP_LOCATION_BUCKET_NAME: ${{ secrets.BACKUP_LOCATION_BUCKET_NAME }}
# BACKUP_LOCATION_ACCESS_KEY: ${{ secrets.BACKUP_LOCATION_ACCESS_KEY }}
# BACKUP_LOCATION_SECRET_KEY: ${{ secrets.BACKUP_LOCATION_SECRET_KEY }}
# BACKUP_LOCATION_REGION: ${{ secrets.BACKUP_LOCATION_REGION }}
# BACKUP_LOCATION_URL: ${{ secrets.BACKUP_LOCATION_URL }}

merge-gatekeeper:
needs: [CI_checks, e2e_execution]
needs: [CI_checks, permission_checks]
name: Merge Gatekeeper
if: ${{ always() }}
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 9e1bfb9

Please sign in to comment.