Merge pull request #799 from yiannistri/fix-e2e-tests #1
This file contains 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: E2E test branch | ||
on: | ||
workflow_call: | ||
secrets: | ||
GKE_CREDENTIALS: | ||
description: "GKE credentials" | ||
GKE_PROJECT_ID: | ||
description: "GKE project ID" | ||
SLACK_WEBHOOK_URL: | ||
description: "WebHook URL to use for Slack" | ||
required: true | ||
inputs: | ||
branch: | ||
type: string | ||
default: "release-v2.9" | ||
env: | ||
GKE_CREDENTIALS: ${{ secrets.GKE_CREDENTIALS }} | ||
GKE_PROJECT_ID: ${{ secrets.GKE_PROJECT_ID }} | ||
jobs: | ||
e2e-tests: | ||
env: | ||
BRANCH: ${{ inputs.branch }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: | | ||
${{ env.BRANCH }} | ||
- name: Login to GHCR registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | ||
- name: Build and push image | ||
env: | ||
REPO: ghcr.io/rancher | ||
run: | | ||
make image-push | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23.x | ||
- uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0 | ||
with: | ||
version: v0.23.0 | ||
install_only: true | ||
- name: Create kind cluster | ||
run: make setup-kind | ||
- name: Set the value | ||
run: | | ||
GKE_PROJECT_ID="${{ env.GKE_PROJECT_ID }}" | ||
echo "GKE_PROJECT_ID=${GKE_PROJECT_ID}" >> $GITHUB_ENV | ||
- name: E2E tests | ||
env: | ||
GKE_CREDENTIALS: "${{ secrets.GKE_CREDENTIALS }}" | ||
REPO: ghcr.io/rancher | ||
run: make e2e-tests | ||
- name: Archive artifacts | ||
if: always() | ||
uses: actions/[email protected] | ||
with: | ||
name: ci-artifacts-${{ env.BRANCH }} | ||
path: _artifacts | ||
if-no-files-found: ignore | ||
- name: Send failed status to slack | ||
if: failure() && github.event_name == 'schedule' | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "AKS Operator E2E test run failed." | ||
}, | ||
"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 |