diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index c948d94f..99d867bf 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -1,5 +1,5 @@ --- -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json name: "Build and Test" on: - pull_request @@ -73,10 +73,13 @@ jobs: name: images path: /tmp - name: Load images into kind cluster + shell: bash run: | kind load image-archive /tmp/k8s-sidecar.tar --name sidecar-testing kind load image-archive /tmp/dummy-server.tar --name sidecar-testing - name: Install Sidecar and Dummy Server + id: install_sidecar + shell: bash run: | wait_for_pod_ready() { while [[ $(kubectl get pods $1 -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for pod '$1' to become ready..." && sleep 5; done @@ -98,6 +101,8 @@ jobs: wait_for_pod_ready "dummy-server-pod" - name: Install Configmaps and Secrets + id: install_configmaps_and_secrets + shell: bash run: | wait_for_pod_log() { while [[ $(kubectl logs $1 | grep $2) == "" ]]; do echo "waiting 5 more seconds for '$2' to appear in logs of pod '$1'..." && sleep 5; done @@ -117,6 +122,7 @@ jobs: # 10 more seconds after the last thing appeared in the logs. sleep 10 - name: Retrieve pod logs + shell: bash run: | mkdir /tmp/logs kubectl logs sidecar > /tmp/logs/sidecar.log