feat: added config to run benchmarks (#3) #30
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: Validate controller | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
run-controller: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Create k8s Kind Cluster | |
uses: helm/[email protected] | |
with: | |
cluster_name: "k8scluster" | |
- name: Generate CRD | |
run: cargo run --bin=crdgen >> crd.yaml | |
- name: Apply CRD | |
run: kubectl apply -f crd.yaml | |
- name: Build Controller | |
run: docker build -t ext-cardano-dbsync:1.0 . | |
- name: Load Image into Kind | |
run: kind load docker-image ext-cardano-dbsync:1.0 --name k8scluster | |
- name: Apply manifest | |
run: kubectl apply -f test/manifest.yaml | |
- name: Wait containers is ready | |
run: sleep 8; | |
- name: Apply manifests | |
run: kubectl apply -f test/dbsyncport.yaml | |
- name: Validate if controller was executed | |
run: | | |
username=$(kubectl describe dbsyncports.demeter.run --namespace project useraccess | grep -oP 'Username: \K\S+') | |
password=$(kubectl describe dbsyncports.demeter.run --namespace project useraccess | grep -oP 'Password: \K\S+') | |
if [ -z "$username" ] && [ -z "$password" ]; then echo "Error: controller not executed" && exit 1; fi |