Run vSphere e2e tests #208
This file contains hidden or 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: Run vSphere e2e tests | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_call: | |
| workflow_dispatch: | |
| env: | |
| VSPHERE_TLS_THUMBPRINT: ${{ secrets.VSPHERE_TLS_THUMBPRINT }} | |
| VSPHERE_SERVER: ${{ secrets.VSPHERE_SERVER }} | |
| VSPHERE_DATACENTER: ${{ secrets.VSPHERE_DATACENTER }} | |
| VSPHERE_DATASTORE: ${{ secrets.VSPHERE_DATASTORE }} | |
| VSPHERE_FOLDER: ${{ secrets.VSPHERE_FOLDER }} | |
| VSPHERE_NETWORK: ${{ secrets.VSPHERE_NETWORK }} | |
| VSPHERE_RESOURCE_POOL: ${{ secrets.VSPHERE_RESOURCE_POOL }} | |
| VSPHERE_USERNAME: ${{ secrets.VSPHERE_USERNAME }} | |
| VSPHERE_PASSWORD: ${{ secrets.VSPHERE_PASSWORD }} | |
| VSPHERE_KUBE_VIP_IP_KUBEADM: ${{ secrets.VSPHERE_KUBE_VIP_IP_KUBEADM }} | |
| VSPHERE_KUBE_VIP_IP_RKE2: ${{ secrets.VSPHERE_KUBE_VIP_IP_RKE2 }} | |
| RANCHER_HOSTNAME: ${{ secrets.INTERNAL_DOMAIN }} | |
| MANAGEMENT_CLUSTER_ENVIRONMENT: "internal-kind" | |
| GINKGO_LABEL_FILTER: "vsphere" | |
| TAG: v0.0.1 | |
| DOCKER_REGISTRY_TOKEN: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
| DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | |
| DOCKER_REGISTRY_CONFIG: ${{ secrets.DOCKER_REGISTRY_CONFIG }} | |
| GINKGO_NODES: 2 | |
| TURTLES_PROVIDERS: "vsphere,kubeadm" | |
| jobs: | |
| run_vsphere_e2e: | |
| runs-on: [self-hosted, vsphere] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: setupGo | |
| uses: actions/[email protected] | |
| with: | |
| go-version-file: go.mod | |
| - name: Display kind version | |
| run: kind version | |
| - name: Display docker version | |
| run: docker version | |
| - name: Run e2e tests | |
| run: make test-e2e | |
| - name: Collect run artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: artifacts_vsphere | |
| path: _artifacts | |
| - name: Send failed status to slack | |
| if: failure() | |
| uses: slackapi/[email protected] | |
| with: | |
| webhook-type: incoming-webhook | |
| payload: | | |
| { | |
| "blocks": [ | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "Rancher Turtles E2E test vSphere run failed. Job trigger by ${{ github.event_name }} event." | |
| }, | |
| "accessory": { | |
| "type": "button", | |
| "text": { | |
| "type": "plain_text", | |
| "text": ":github:", | |
| "emoji": true | |
| }, | |
| "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| } | |
| } | |
| ] | |
| } | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
| - name: Docker cleanup | |
| if: always() | |
| run: | | |
| CONTAINERS=$(docker ps --all --quiet) | |
| if [ -n "$CONTAINERS" ]; then | |
| docker stop $CONTAINERS | |
| fi | |
| docker system prune --all --volumes --force | |
| docker network create \ | |
| --driver=bridge \ | |
| --subnet=172.19.0.0/16 \ | |
| --gateway=172.19.0.1 \ | |
| --opt "com.docker.network.bridge.enable_ip_masquerade"="true" \ | |
| --opt "com.docker.network.driver.mtu"="1500" \ | |
| kind |