|
27 | 27 | echo "Cluster: ${{ inputs.cluster }}" |
28 | 28 | echo "Prefix: ${{ inputs.prefix }}" |
29 | 29 |
|
| 30 | + create-cluster: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + outputs: |
| 33 | + cluster-name: ${{ steps.determine-cluster-name.outputs.cluster-name }} |
| 34 | + steps: |
| 35 | + - name: Determine cluster name |
| 36 | + id: determine-cluster-name |
| 37 | + run: | |
| 38 | + echo "cluster-name=daily-smoke-test-$(date +%s)" >> ${GITHUB_OUTPUT} |
| 39 | +
|
| 40 | + - uses: stackrox/actions/infra/create-cluster@v1 |
| 41 | + with: |
| 42 | + token: ${{ secrets.INFRA_TOKEN }} |
| 43 | + flavor: gke-default |
| 44 | + name: ${{ steps.determine-cluster-name.outputs.cluster-name }} |
| 45 | + lifespan: 8h |
| 46 | + wait: true |
| 47 | + |
| 48 | + - name: Checkout |
| 49 | + uses: actions/checkout@v4 |
| 50 | + with: |
| 51 | + fetch-depth: 0 |
| 52 | + ref: ${{ github.event.pull_request.head.sha }} |
| 53 | + |
| 54 | + - name: Authenticate to GCloud |
| 55 | + uses: google-github-actions/auth@v2 |
| 56 | + with: |
| 57 | + credentials_json: ${{ secrets.INFRA_CI_AUTOMATION_GCP_SA }} |
| 58 | + |
| 59 | + - name: Set up Cloud SDK |
| 60 | + uses: "google-github-actions/setup-gcloud@v2" |
| 61 | + with: |
| 62 | + install_components: "gke-gcloud-auth-plugin" |
| 63 | + |
| 64 | + - name: Download production infractl |
| 65 | + uses: stackrox/actions/infra/install-infractl@v1 |
| 66 | + |
| 67 | + - name: Download artifacts |
| 68 | + env: |
| 69 | + INFRA_TOKEN: ${{ secrets.INFRA_TOKEN }} |
| 70 | + run: | |
| 71 | + /home/runner/.local/bin/infractl artifacts "${{ steps.determine-cluster-name.outputs.cluster-name }}" -d /home/runner/artifacts >> "$GITHUB_STEP_SUMMARY" |
| 72 | +
|
| 73 | + - name: Deploy infra to smoke test cluster |
| 74 | + run: | |
| 75 | + ENVIRONMENT=development TEST_MODE=true make install-argo clean-argo-config install-monitoring helm-deploy |
| 76 | +
|
30 | 77 | smoke-test: |
31 | 78 | runs-on: ubuntu-latest |
| 79 | + needs: [create-cluster] |
32 | 80 | env: |
33 | 81 | KUBECONFIG: /home/runner/artifacts/kubeconfig |
34 | 82 | INFRA_TOKEN_PROD: ${{ secrets.INFRA_TOKEN }} |
@@ -67,12 +115,12 @@ jobs: |
67 | 115 | - name: Download production infractl |
68 | 116 | uses: stackrox/actions/infra/install-infractl@v1 |
69 | 117 |
|
70 | | - - name: Download artifacts for cluster ${{ inputs.cluster }} |
| 118 | + - name: Download artifacts for cluster ${{ needs.create-cluster.outputs.cluster-name }} |
71 | 119 | env: |
72 | 120 | INFRA_TOKEN: ${{ env.INFRA_TOKEN_PROD }} |
73 | 121 | run: | |
74 | 122 | set -uo pipefail |
75 | | - infractl artifacts "${{ inputs.cluster }}" -d "/home/runner/artifacts" >> "$GITHUB_STEP_SUMMARY" |
| 123 | + infractl artifacts "${{ needs.create-cluster.outputs.cluster-name }}" -d "/home/runner/artifacts" >> "$GITHUB_STEP_SUMMARY" |
76 | 124 | kubectl -n infra port-forward svc/infra-server-service 8443:8443 & |
77 | 125 | sleep 10 |
78 | 126 |
|
|
87 | 135 | endpoint: localhost:8443 |
88 | 136 | insecure: true |
89 | 137 | args: ${{ matrix.flavors.args }} |
| 138 | + no-slack: true |
0 commit comments