diff --git a/.github/workflows/e2e-main.yaml b/.github/workflows/e2e-branch.yaml similarity index 96% rename from .github/workflows/e2e-main.yaml rename to .github/workflows/e2e-branch.yaml index 9b3ef5c7..ccf8fb4f 100644 --- a/.github/workflows/e2e-main.yaml +++ b/.github/workflows/e2e-branch.yaml @@ -1,4 +1,4 @@ -name: E2E test main +name: E2E test branch on: workflow_call: secrets: @@ -17,11 +17,15 @@ on: SLACK_WEBHOOK_URL: description: "WebHook URL to use for Slack" required: true + inputs: + branch: + type: string + default: "release-v2.9" jobs: e2e-tests: env: - BRANCH: main + BRANCH: ${{ inputs.branch }} REPO: ttl.sh/aks-operator-ci runs-on: ubuntu-latest steps: diff --git a/.github/workflows/e2e-release.yaml b/.github/workflows/e2e-release.yaml deleted file mode 100644 index 11912526..00000000 --- a/.github/workflows/e2e-release.yaml +++ /dev/null @@ -1,121 +0,0 @@ -name: E2E test release branch -on: - workflow_dispatch: - secrets: - AZURE_CLIENT_ID: - description: "Azure client ID" - required: true - AZURE_CLIENT_SECRET: - description: "Azure client secret" - required: true - AZURE_SUBSCRIPTION_ID: - description: "Azure subscription ID" - required: true - AZURE_RESOURCE_GROUP: - description: "Azure resource group" - required: true - SLACK_WEBHOOK_URL: - description: "WebHook URL to use for Slack" - required: true - inputs: - branch: - type: string - default: "release-v2.9" - -jobs: - e2e-tests: - env: - BRANCH: ${{ inputs.branch }} - REPO: ttl.sh/aks-operator-ci - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: | - $ {{ env.BRANCH }} - - name: Export tag - id: export_tag - run: | - TAG=`git describe --abbrev=0 --tags 2>/dev/null` - COMMITDATE=`date -d @$(git log -n1 --format="%at") "+%FT%TZ"` - echo "operator_tag=$TAG" >> $GITHUB_OUTPUT - echo "commit_date=$COMMITDATE" >> $GITHUB_OUTPUT - - name: Docker meta - id: meta - uses: docker/metadata-action@v5.5.1 - with: - images: | - ${{ env.REPO }} - tags: | - type=sha,format=short,prefix=${{ steps.export_tag.outputs.operator_tag }}- - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3.2.0 - - name: Build and push image - uses: docker/build-push-action@v5.3.0 - with: - context: . - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - push: true - cache-from: type=gha - cache-to: type=gha,mode=max - target: aks-operator - file: test/e2e/Dockerfile.e2e - build-args: | - TAG=${{ steps.export_tag.outputs.operator_tag }} - COMMITDATE=${{ steps.export_tag.outputs.commit_date }} - COMMIT=${{ github.sha }} - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.21.x - - uses: engineerd/setup-kind@v0.5.0 - with: - version: "v0.16.0" - skipClusterCreation: "true" - - name: Create kind cluster - run: make setup-kind - - name: E2E tests - env: - AZURE_CLIENT_ID: "${{ secrets.AZURE_CLIENT_ID }}" - AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} - run: make e2e-tests - - name: Archive artifacts - if: always() - uses: actions/upload-artifact@v4.3.1 - with: - name: ci-artifacts - path: _artifacts - if-no-files-found: ignore - - name: Send failed status to slack - if: failure() && github.event_name == 'schedule' - uses: slackapi/slack-github-action@v1.25.0 - 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 diff --git a/.github/workflows/e2e-workflow.yaml b/.github/workflows/e2e-workflow.yaml index 908bcb1b..32295746 100644 --- a/.github/workflows/e2e-workflow.yaml +++ b/.github/workflows/e2e-workflow.yaml @@ -1,4 +1,4 @@ -name: e2e-latest-rancher +name: Run E2E test workflow on: workflow_dispatch: schedule: @@ -6,39 +6,51 @@ on: permissions: read-all jobs: e2e-test-main: - uses: ./.github/workflows/e2e-main.yaml + uses: ./.github/workflows/e2e-branch.yaml + with: + branch: main secrets: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - e2e-test-v2.9: - uses: ./.github/workflows/e2e-release.yaml + e2e-test-v2_9: + if: ${{ always() }} + needs: e2e-test-main + uses: ./.github/workflows/e2e-branch.yaml + with: + branch: release-v2.9 secrets: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - branch: release-v2.9 - e2e-test-v2.8: - uses: ./.github/workflows/e2e-release.yaml + e2e-test-v2_8: + if: ${{ always() }} + needs: [ e2e-test-main, e2e-test-v2_9 ] + uses: ./.github/workflows/e2e-branch.yaml + with: + branch: release-v2.8 secrets: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - branch: release-v2.8 - e2e-test-v2.7: - uses: ./.github/workflows/e2e-release.yaml + e2e-test-v2_7: + if: ${{ always() }} + needs: [ e2e-test-main, e2e-test-v2_9, e2e-test-v2_8 ] + uses: ./.github/workflows/e2e-branch.yaml + with: + branch: release-v2.7 secrets: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - branch: release-v2.7 +