Skip to content

Commit

Permalink
Add workflow-dispatch to functional-tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-rogers-dbt committed Sep 12, 2024
1 parent e80a2d1 commit 73498ee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 28 deletions.
24 changes: 4 additions & 20 deletions .github/workflows/functional-tests-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# reusable workflow to be called from the main workflow
name: functional-tests-workflow
run-name: "${{ (contains(github.event_name, 'workflow_') && inputs.name) || github.event_name }}: ${{ (contains(github.event_name, 'workflow_') && inputs.adapter_branch) || github.ref_name }} by @${{ github.actor }}"

on:
workflow_call:
Expand All @@ -10,23 +11,9 @@ on:
checkout-repository:
required: true
type: string
concurrency-group:
required: true
type: string
workflow_dispatch:
inputs:
checkout-ref:
required: false
default: ${{ github.ref }}
type: string
checkout-repository:
required: false
type: string
default: ${{ github.repository }}
concurrency-group:
required: true
type: string
default: ${{ github.repository }}-${{ github.ref }}-${{ github.actor }}
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }}
cancel-in-progress: true

env:
DBT_TEST_ATHENA_DATABASE: awsdatacatalog
Expand All @@ -40,9 +27,6 @@ jobs:
functional-tests:
name: Functional Tests
runs-on: ubuntu-latest
concurrency:
group: ${{ inputs.concurrency-group }}
cancel-in-progress: false
env:
DBT_TEST_ATHENA_S3_STAGING_DIR: ${{ vars.DBT_TEST_ATHENA_S3_BUCKET }}/staging/
DBT_TEST_ATHENA_S3_TMP_TABLE_DIR: ${{ vars.DBT_TEST_ATHENA_S3_BUCKET }}/tmp_tables/
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ on:
types: [opened, reopened, synchronize, labeled]
push:
branches: [main]
workflow_dispatch:
workflow_call:
inputs:
checkout-ref:
required: true
type: string
checkout-repository:
required: true
type: string

jobs:
# workflow that is invoked when for PRs with labels 'enable-functional-tests'
Expand All @@ -25,23 +34,19 @@ jobs:
checkout-ref: ${{ github.event.pull_request.head.ref }}
# this allows to work on fork
checkout-repository: ${{ github.event.pull_request.head.repo.full_name }}
aws-region: ${{ matrix.aws-region }}
concurrency-group: functional_tests_pr_${{ matrix.aws-region }}

# workflow that is invoked when a push to main happens
functional-tests-main:
name: Functional Tests - main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: |
github.event_name == 'push' && github.ref == 'refs/heads/main'
|| github.event_name == 'workflow_dispatch'
|| github.event_name == 'workflow_call'
uses: ./.github/workflows/functional-tests-workflow.yml
secrets: inherit
strategy:
matrix:
aws-region: ['us-east-1', 'eu-central-1']
permissions:
id-token: write
contents: read
with:
checkout-ref: ${{ github.ref }}
checkout-repository: ${{ github.repository }}
aws-region: ${{ matrix.aws-region }}
concurrency-group: functional_tests_main_${{ matrix.aws-region }}

0 comments on commit 73498ee

Please sign in to comment.