Skip to content

Commit

Permalink
test: Remove CCTP tests on approval (#1940)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstph-dvx authored Sep 27, 2024
1 parent 4f89ac3 commit 2b3d65c
Showing 1 changed file with 4 additions and 40 deletions.
44 changes: 4 additions & 40 deletions .github/workflows/run-cctp-tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: PR approved workflow
name: CCTP Tests

on:
workflow_dispatch:
pull_request_review:
types:
- submitted


# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-cctp
group: ${{ github.workflow }}-${{ github.ref }}-cctp
cancel-in-progress: true

env:
Expand All @@ -18,42 +15,9 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
check-files:
name: Check files
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.check-files.outputs.run_tests }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/check-files
id: check-files

should-run-tests:
runs-on: ubuntu-latest
needs: [check-files]
outputs:
should_run: ${{ steps.should-run-tests.outputs.should_run }}
steps:
- name: Check trigger type and conditions
id: should-run-tests
run: |
if [[ "${{ github.event_name }}" == "pull_request_review" ]]; then
if [[ "${{ github.event.review.state }}" == "approved" && "${{ needs.check-files.outputs.run_tests }}" == "true" && "${{ contains(github.event.pull_request.title, 'hotfix') }}" == "false" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
build:
name: "Build"
runs-on: ubuntu-latest
needs: [should-run-tests]
if: needs.should-run-tests.outputs.should_run == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -74,7 +38,7 @@ jobs:

cctp-e2e-tests:
name: "CCTP E2E Tests"
needs: [build, check-files]
needs: [build]
uses: ./.github/workflows/e2e-tests.yml
with:
test_type: 'cctp'
Expand Down

0 comments on commit 2b3d65c

Please sign in to comment.