From 1d9f67347ce61378cecb9eb832312eb26bdc8060 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 6 Jun 2024 18:01:17 -0700 Subject: [PATCH] Fix label removal logic for SQL engine tests (#1253) ### Description This PR fixes an issue where `Run Tests With Other SQL Engines` label isn't getting removed when tests fail. --- .github/workflows/cd-sql-engine-tests.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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