-
Notifications
You must be signed in to change notification settings - Fork 36
102 lines (90 loc) · 4.19 KB
/
unit.yml
File metadata and controls
102 lines (90 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
on:
pull_request_target:
branches:
- main
merge_group:
branches:
- main
schedule:
# every sunday at 2:45 AM so we catch up issues that might not have been raised yet
- cron: '45 2 * * 0'
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pull-requests: write
name: dbt Cloud Integration Tests
jobs:
check-changie:
if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')"
runs-on: ubuntu-latest
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'cloud-tests' || '' }}
steps:
- name: Checkout code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
with:
fetch-depth: 0
- name: Debug refs
run: |
git remote -v
git branch -a
git log --oneline --decorate --graph --all -n 20
- name: Check for changie changes
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
git fetch origin $BASE_REF
git fetch origin pull/$PR_NUMBER/head:pr_branch
echo "Comparing changes between origin/$BASE_REF and pr_branch..."
if ! git diff --name-only origin/$BASE_REF...pr_branch | grep -q "^.changes/"; then
echo "::error::No changie changes detected. Please add a changelog entry using changie. https://changie.dev/guide/quick_start/"
exit 1
fi
fi
unit:
if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')"
needs: check-changie
runs-on: ubuntu-latest
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'cloud-tests' || '' }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.target == 'test-acceptance' || github.ref }}
cancel-in-progress: false
strategy:
matrix:
target:
- check-docs
- test
- test-acceptance
steps:
- name: pull_request actions/checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@19bb51245e9c80abacb2e91cc42b33fa478b8639 # actions/setup-go@v4
with:
go-version: '>=1.17.0'
- name: Install dependencies
run: make setup
# we install Terraform beforehand, otherwise each test requires downloading it
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # hashicorp/setup-terraform@v3
- name: make ${{ matrix.target }}
run: make ${{ matrix.target }}
env:
DBT_CLOUD_ACCOUNT_ID: ${{ secrets.TEST_DBT_CLOUD_ACCOUNT_ID }}
DBT_CLOUD_TOKEN: ${{ secrets.TEST_DBT_CLOUD_TOKEN }}
DBT_CLOUD_HOST_URL: ${{ secrets.TEST_DBT_CLOUD_HOST_URL }}
DBT_ACCEPTANCE_TEST_LINEAGE_INTEGRATION: ${{ secrets.DBT_ACCEPTANCE_TEST_LINEAGE_INTEGRATION }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_ACCOUNT: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_ACCOUNT }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_DATABASE: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_DATABASE }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_WAREHOUSE: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_WAREHOUSE }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_USER: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_USER }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_PASSWORD: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_PASSWORD }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_ROLE: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_ROLE }}
DBT_ACCEPTANCE_TEST_DATABRICKS_HOST: ${{ secrets.DBT_ACCEPTANCE_TEST_DATABRICKS_HOST }}
DBT_ACCEPTANCE_TEST_DATABRICKS_HTTP_PATH: ${{ secrets.DBT_ACCEPTANCE_TEST_DATABRICKS_HTTP_PATH }}
DBT_ACCEPTANCE_TEST_DATABRICKS_TOKEN: ${{ secrets.DBT_ACCEPTANCE_TEST_DATABRICKS_TOKEN }}
DBT_ACCEPTANCE_TEST_DATABRICKS_CATALOG: ${{ secrets.DBT_ACCEPTANCE_TEST_DATABRICKS_CATALOG }}