Skip to content

Commit 728b6d7

Browse files
committed
test
1 parent 945d310 commit 728b6d7

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

.github/workflows/test-all-warehouses.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Test all warehouse platforms
22
on:
3-
pull_request_target:
3+
pull_request:
44
branches: ["master"]
55
# Allows you to run this workflow manually from the Actions tab
66
workflow_dispatch:
@@ -41,22 +41,8 @@ jobs:
4141
fromJSON('["latest_official"]') }}
4242
warehouse-type:
4343
[
44-
postgres,
45-
snowflake,
46-
bigquery,
47-
redshift,
48-
databricks_catalog,
49-
athena,
50-
trino,
51-
clickhouse,
52-
dremio,
44+
postgres
5345
]
54-
include:
55-
# If we're not running on a specific dbt version, then always add postgres on 1.8.0
56-
- dbt-version: "${{ inputs.dbt-version || '1.8.0' }}"
57-
warehouse-type: postgres
58-
- dbt-version: "${{ inputs.dbt-version || 'latest_pre' }}"
59-
warehouse-type: postgres
6046
uses: ./.github/workflows/test-warehouse.yml
6147
with:
6248
warehouse-type: ${{ matrix.warehouse-type }}

.github/workflows/test-warehouse.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,25 @@ env:
5353
TESTS_DIR: ${{ github.workspace }}/dbt-data-reliability/integration_tests
5454

5555
jobs:
56+
detect-fork:
57+
runs-on: ubuntu-latest
58+
outputs:
59+
requires_approval: ${{ steps.set-output.outputs.requires_approval }}
60+
steps:
61+
- name: Set fork output
62+
id: set-output
63+
run: |
64+
if [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
65+
echo "requires_approval=true" >> $GITHUB_OUTPUT
66+
else
67+
echo "requires_approval=false" >> $GITHUB_OUTPUT
68+
fi
69+
5670
test:
5771
runs-on: ubuntu-latest
58-
environment: elementary_test_env # This is a github environment (not to be confused with env vars)
72+
needs: [detect-fork]
73+
# PRs from forks require approval - so we use an environment that requires an approver from the team.
74+
environment: ${{ (needs.detect-fork.outputs.requires_approval == 'true' && 'elementary_test_env') || '' }}
5975
concurrency:
6076
# This is what eventually defines the schema name in the data platform.
6177
group: tests_${{ inputs.warehouse-type }}_dbt_${{ inputs.dbt-version }}_${{ github.head_ref || github.ref_name }}

0 commit comments

Comments
 (0)