From efad402530b4591a3cb7023150d22af37fbffa5b Mon Sep 17 00:00:00 2001 From: itsankit-google Date: Sat, 12 Nov 2022 10:10:41 +0530 Subject: [PATCH] remove trigger to run e2e tests on separate google-cloud repo branch --- .github/workflows/e2e.yml | 27 ++++++-------------- .github/workflows/trigger.yml | 47 ----------------------------------- 2 files changed, 8 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/trigger.yml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 4f91360cd..88c793cb5 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -15,11 +15,11 @@ name: Build e2e tests on: - workflow_run: - workflows: - - Trigger build - types: - - completed + push: + branches: [ develop, release/** ] + pull_request: + branches: [ develop, release/** ] + types: [opened, synchronize, reopened, labeled] jobs: build: @@ -29,8 +29,6 @@ jobs: outputs: version: ${{ steps.version.outputs.version }} steps: - # Pinned 1.0.0 version - - uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 - uses: actions/checkout@v3 with: repository: data-integrations/google-cloud @@ -39,7 +37,6 @@ jobs: uses: actions/checkout@v3 with: path: e2e - ref: ${{ github.event.workflow_run.head_sha }} - name: Cache uses: actions/cache@v3 with: @@ -48,10 +45,10 @@ jobs: restore-keys: | ${{ runner.os }}-maven-${{ github.workflow }} - name: Run required e2e tests - if: ${{ github.event.workflow_run.event != 'workflow_dispatch' && github.event.workflow_run.event != 'push' }} + if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'push' }} run: python3 e2e/src/main/scripts/run_e2e_test.py --testRunner TestRunnerRequired.java --framework yes - name: Run all e2e tests - if: ${{ github.event.workflow_run.event == 'workflow_dispatch' || github.event.workflow_run.event == 'push' }} + if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }} run: python3 e2e/src/main/scripts/run_e2e_test.py --framework yes - name: Upload report uses: actions/upload-artifact@v3 @@ -71,17 +68,9 @@ jobs: with: path: ./plugin/target/cucumber-reports destination: e2e-tests-cucumber-reports/${{ github.event.repository.name }}/${{ github.ref }} - - name: github-status-action - uses: Sibz/github-status-action@67af1f4042a5a790681aad83c44008ca6cfab83d - if: always() - with: - authToken: ${{ secrets.GITHUB_TOKEN }} - state: success - context: Cucumber report - sha: ${{ github.event.workflow_run.head_sha }} maven-deploy: - if: ${{ github.event.workflow_run.event == 'push' }} + if: ${{ github.event_name == 'push' }} # needs: build TODO: once build is fixed uses: ./.github/workflows/deploy.yml with: diff --git a/.github/workflows/trigger.yml b/.github/workflows/trigger.yml deleted file mode 100644 index e5693af07..000000000 --- a/.github/workflows/trigger.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright © 2021 Cask Data, Inc. -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -# This workflow will trigger build.yml only when needed. -# This way we don't flood main workflow run list -# Note that build.yml from develop will be used even for PR builds -# Also it will have access to the proper GITHUB_SECRET - -name: Trigger build - -on: - push: - branches: [ develop, release/** ] - pull_request: - branches: [ develop, release/** ] - types: [opened, synchronize, reopened, labeled] - workflow_dispatch: - -jobs: - trigger: - runs-on: ubuntu-latest - - # We allow builds: - # 1) When triggered manually - # 2) When it's a merge into a branch - # 3) For PRs that are labeled as build and - # - It's a code change - # - A build label was just added - # A bit complex, but prevents builds when other labels are manipulated - if: > - github.event_name == 'workflow_dispatch' - || github.event_name == 'push' - || (contains(github.event.pull_request.labels.*.name, 'build') - && (github.event.action != 'labeled' || github.event.label.name == 'build') - ) - - steps: - - name: Trigger build - run: echo Maven build will be triggered now