From de8cb0338ba918e937bc08e0b320d45a0f2c28b8 Mon Sep 17 00:00:00 2001 From: neuronull Date: Wed, 5 Jul 2023 13:22:27 -0600 Subject: [PATCH] test k8s changes --- .github/workflows/comment-trigger.yml | 6 ++++ .github/workflows/k8s_e2e.yml | 49 ++++----------------------- 2 files changed, 13 insertions(+), 42 deletions(-) diff --git a/.github/workflows/comment-trigger.yml b/.github/workflows/comment-trigger.yml index d7e5fd5ca0bd8..05bccb3055063 100644 --- a/.github/workflows/comment-trigger.yml +++ b/.github/workflows/comment-trigger.yml @@ -134,3 +134,9 @@ jobs: if: contains(github.event.comment.body, '/ci-run-all') || contains(github.event.comment.body, '/ci-run-regression') uses: ./.github/workflows/regression.yml secrets: inherit + + k8s: + needs: validate + if: contains(github.event.comment.body, '/ci-run-all') || contains(github.event.comment.body, '/ci-run-k8s') + uses: ./.github/workflows/k8s_e2e.yml + secrets: inherit diff --git a/.github/workflows/k8s_e2e.yml b/.github/workflows/k8s_e2e.yml index 69e49c5f3e0c5..d0f9567849cc8 100644 --- a/.github/workflows/k8s_e2e.yml +++ b/.github/workflows/k8s_e2e.yml @@ -16,9 +16,8 @@ name: K8S E2E Suite on: workflow_dispatch: + workflow_call: pull_request: - issue_comment: - types: [created] merge_group: types: [checks_requested] # schedule: @@ -27,7 +26,6 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.event.comment.html_url || github.event.merge_group.head_sha || github.event.schedule || github.sha }} - cancel-in-progress: true env: @@ -42,31 +40,8 @@ env: PROFILE: debug jobs: - validate: - name: Validate comment - runs-on: ubuntu-latest - steps: - - name: Get PR comment author - if: | - github.event_name == 'issue_comment' && github.event.issue.pull_request && - ( contains(github.event.comment.body, '/ci-run-all') || - contains(github.event.comment.body, '/ci-run-k8s') - ) - id: comment - uses: tspascoal/get-user-teams-membership@v2 - with: - username: ${{ github.actor }} - team: 'Vector' - GITHUB_TOKEN: ${{ secrets.GH_PAT_ORG }} - - - name: Validate author membership - if: steps.comment.outputs.isTeamMember == 'false' - run: exit 1 - changes: - needs: validate - if: github.event_name != 'issue_comment' || (github.event.issue.pull_request && - (contains(github.event.comment.body, '/ci-run-k8s') || contains(github.event.comment.body, '/ci-run-all'))) + if: github.event_name == 'pull_request' uses: ./.github/workflows/changes.yml with: base_ref: ${{ github.event.pull_request.base.ref }} @@ -77,7 +52,7 @@ jobs: name: Build - x86_64-unknown-linux-gnu runs-on: [linux, ubuntu-20.04-4core] needs: changes - if: github.event_name != 'pull_request' || needs.changes.outputs.k8s == 'true' + if: always() && (github.event_name != 'pull_request' || needs.changes.outputs.k8s == 'true') # cargo-deb requires a release build, but we don't need optimizations for tests env: CARGO_PROFILE_RELEASE_OPT_LEVEL: 0 @@ -158,7 +133,7 @@ jobs: name: Compute K8s test plan runs-on: ubuntu-20.04 needs: changes - if: github.event_name != 'pull_request' || needs.changes.outputs.k8s == 'true' + if: always() && (github.event_name != 'pull_request' || needs.changes.outputs.k8s == 'true') outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: @@ -270,27 +245,17 @@ jobs: name: K8s E2E Suite runs-on: ubuntu-latest needs: test-e2e-kubernetes - if: | - always() && (github.event_name != 'issue_comment' || (github.event.issue.pull_request - && (contains(github.event.comment.body, '/ci-run-k8s') || contains(github.event.comment.body, '/ci-run-all')))) + if: always() env: FAILED: ${{ contains(needs.*.result, 'failure') }} steps: - - name: Validate issue comment - if: github.event_name == 'issue_comment' - uses: tspascoal/get-user-teams-membership@v2 - with: - username: ${{ github.actor }} - team: 'Vector' - GITHUB_TOKEN: ${{ secrets.GH_PAT_ORG }} - - name: (PR comment) Get PR branch - if: success() && github.event_name == 'issue_comment' + if: github.event_name == 'issue_comment' && env.FAILED != 'true' uses: xt0rted/pull-request-comment-branch@v2 id: comment-branch - name: (PR comment) Submit PR result as success - if: success() && github.event_name == 'issue_comment' + if: github.event_name == 'issue_comment' && env.FAILED != 'true' uses: myrotvorets/set-commit-status-action@v1.1.7 with: sha: ${{ steps.comment-branch.outputs.head_sha }}