|
57 | 57 |
|
58 | 58 | - env: { PGO_TEST_TIMEOUT_SCALE: 1.2 }
|
59 | 59 | run: make createnamespaces check-envtest-existing
|
| 60 | + |
| 61 | + kuttl-k3d: |
| 62 | + runs-on: ubuntu-latest |
| 63 | + needs: [go-test] |
| 64 | + strategy: |
| 65 | + fail-fast: false |
| 66 | + matrix: |
| 67 | + kubernetes: [latest] |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v2 |
| 70 | + - uses: actions/setup-go@v2 |
| 71 | + with: { go-version: 1.x } |
| 72 | + |
| 73 | + - name: Start k3s |
| 74 | + uses: ./.github/actions/k3d |
| 75 | + with: |
| 76 | + k3s-channel: "${{ matrix.kubernetes }}" |
| 77 | + prefetch-images: | |
| 78 | + registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:centos8-13.4-4.7.3 |
| 79 | + registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.36-0 |
| 80 | + registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:centos8-1.16-0 |
| 81 | + registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-14.1-0 |
| 82 | +
|
| 83 | + - run: go mod download |
| 84 | + - name: Build PGO |
| 85 | + run: | |
| 86 | + make build-postgres-operator PGO_VERSION=${{ github.sha }} |
| 87 | +
|
| 88 | + # Start a Docker container with the working directory mounted. |
| 89 | + - name: Start PGO |
| 90 | + run: | |
| 91 | + kubectl apply -k ./config/namespace; kubectl apply -k ./config/dev |
| 92 | + hack/create-kubeconfig.sh postgres-operator pgo |
| 93 | +
|
| 94 | + docker run --detach --network host --read-only \ |
| 95 | + --volume "$(pwd):/mnt" --workdir '/mnt' --env 'PATH=/mnt/bin' \ |
| 96 | + --env 'KUBECONFIG=hack/.kube/postgres-operator/pgo' \ |
| 97 | + --env 'RELATED_IMAGE_PGADMIN=registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:centos8-13.4-4.7.3' \ |
| 98 | + --env 'RELATED_IMAGE_PGBACKREST=registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.36-0' \ |
| 99 | + --env 'RELATED_IMAGE_PGBOUNCER=registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:centos8-1.16-0' \ |
| 100 | + --env 'RELATED_IMAGE_POSTGRES_14=registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-14.1-0' \ |
| 101 | + --name 'postgres-operator' ubuntu \ |
| 102 | + postgres-operator |
| 103 | +
|
| 104 | + - name: Install KUTTL |
| 105 | + run: | |
| 106 | + KREW="krew-$(uname -s)_$(uname -m)"; KREW="${KREW/x86_/amd}"; KREW="${KREW,,}" |
| 107 | + curl --fail --location --silent --show-error \ |
| 108 | + "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" | |
| 109 | + tar xz --directory hack/tools --wildcards "*${KREW}*" |
| 110 | + "hack/tools/${KREW}" install kuttl |
| 111 | +
|
| 112 | + - run: | |
| 113 | + make check-kuttl PATH="$PATH:$HOME/.krew/bin" && exit |
| 114 | + failed=$? |
| 115 | + echo '::group::PGO logs'; docker logs 'postgres-operator'; echo '::endgroup::' |
| 116 | + exit $failed |
0 commit comments