From 084d620832a15aa508b6c7ed19af216502728ece Mon Sep 17 00:00:00 2001 From: itsankit-google Date: Tue, 18 Mar 2025 12:12:56 +0000 Subject: [PATCH] remove trigger build yml from e2e workflow --- .github/workflows/e2e.yml | 60 +++++++++++++++++++-------------------- pom.xml | 2 +- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5216a234..d0cd4011 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -15,34 +15,44 @@ 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 ] + workflow_dispatch: jobs: - build: + build-e2e-tests: runs-on: k8s-runner-e2e - - if: ${{ github.event.workflow_run.conclusion != 'skipped' }} + # 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: - # Pinned 1.0.0 version - - uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: plugin - ref: ${{ github.event.workflow_run.head_sha }} - name: Checkout e2e test repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: cdapio/cdap-e2e-tests path: e2e + ref: release/6.11 - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }} @@ -51,7 +61,7 @@ jobs: - name: Get Secrets from GCP Secret Manager id: 'secrets' - uses: 'google-github-actions/get-secretmanager-secrets@v0' + uses: 'google-github-actions/get-secretmanager-secrets@v2' with: secrets: |- SALESFORCE_USERNAME:cdapio-github-builds/SALESFORCE_USERNAME @@ -69,33 +79,21 @@ jobs: SALESFORCE_CONSUMER_KEY: ${{ steps.secrets.outputs.SALESFORCE_CONSUMER_KEY }} SALESFORCE_CONSUMER_SECRET: ${{ steps.secrets.outputs.SALESFORCE_CONSUMER_SECRET }} - - name: Upload report - uses: actions/upload-artifact@v3 - if: always() - with: - name: Cucumber report - path: ./plugin/target/cucumber-reports - - name: Upload debug files - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: Debug files path: ./**/target/e2e-debug - name: Upload reports to GCS - uses: google-github-actions/upload-cloud-storage@v0 + uses: google-github-actions/upload-cloud-storage@v2 if: always() 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 + - name: Cucumber Report URL if: always() - with: - authToken: ${{ secrets.GITHUB_TOKEN }} - state: success - context: Cucumber report - sha: ${{github.event.pull_request.head.sha || github.sha}} + run: echo "https://storage.googleapis.com/e2e-tests-cucumber-reports/${{ github.event.repository.name }}/${{ github.ref }}/cucumber-reports/advanced-reports/cucumber-html-reports/overview-features.html" diff --git a/pom.xml b/pom.xml index 053b4b46..c22dd0c4 100644 --- a/pom.xml +++ b/pom.xml @@ -789,7 +789,7 @@ io.cdap.tests.e2e cdap-e2e-framework - 0.4.0-SNAPSHOT + 0.4.0 test