Skip to content

Commit 15ee041

Browse files
committed
let smoke test provision its own cluster
ifx action fix wait deploy infra to the cluster fix home location fix missing infra token fix
1 parent fe45e56 commit 15ee041

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

.github/workflows/smoke-test.yaml

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,56 @@ jobs:
2727
echo "Cluster: ${{ inputs.cluster }}"
2828
echo "Prefix: ${{ inputs.prefix }}"
2929
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+
3077
smoke-test:
3178
runs-on: ubuntu-latest
79+
needs: [create-cluster]
3280
env:
3381
KUBECONFIG: /home/runner/artifacts/kubeconfig
3482
INFRA_TOKEN_PROD: ${{ secrets.INFRA_TOKEN }}
@@ -67,12 +115,12 @@ jobs:
67115
- name: Download production infractl
68116
uses: stackrox/actions/infra/install-infractl@v1
69117

70-
- name: Download artifacts for cluster ${{ inputs.cluster }}
118+
- name: Download artifacts for cluster ${{ needs.create-cluster.outputs.cluster-name }}
71119
env:
72120
INFRA_TOKEN: ${{ env.INFRA_TOKEN_PROD }}
73121
run: |
74122
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"
76124
kubectl -n infra port-forward svc/infra-server-service 8443:8443 &
77125
sleep 10
78126
@@ -87,3 +135,4 @@ jobs:
87135
endpoint: localhost:8443
88136
insecure: true
89137
args: ${{ matrix.flavors.args }}
138+
no-slack: true

0 commit comments

Comments
 (0)