diff --git a/.github/workflows/cd-sql-engine-tests.yaml b/.github/workflows/cd-sql-engine-tests.yaml index bb0782bc21..ebd7ffedf1 100644 --- a/.github/workflows/cd-sql-engine-tests.yaml +++ b/.github/workflows/cd-sql-engine-tests.yaml @@ -4,6 +4,7 @@ name: MetricFlow SQL Engine Tests on: workflow_dispatch: + pull_request: types: [labeled] @@ -15,6 +16,8 @@ env: jobs: snowflake-tests: environment: DW_INTEGRATION_TESTS + # Run if manually triggered. Example case: run against `main` to check if something is broken. + # Run if a PR is given a specific label. if: ${{ github.event.action != 'labeled' || github.event.label.name == 'Run Tests With Other SQL Engines' }} name: Snowflake Tests runs-on: ubuntu-latest @@ -115,7 +118,8 @@ jobs: name: Remove Label After Running Tests runs-on: ubuntu-latest needs: [ snowflake-tests, redshift-tests, bigquery-tests, databricks-tests ] - if: github.event.action == 'labeled' && github.event.label.name == 'Run Tests With Other SQL Engines' + # Default behavior for `needs` is that it requires success, so a success / failure needs to be specifically checked. + if: ${{ (success() || failure()) && github.event.action == 'labeled' }} steps: - name: Remove Label uses: actions-ecosystem/action-remove-labels@v1