-
Notifications
You must be signed in to change notification settings - Fork 0
209 lines (187 loc) · 6.99 KB
/
examples.yml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: Test sdf-action
on:
workflow_dispatch:
pull_request:
jobs:
tpch_redshift:
runs-on: ubuntu-latest
name: Redshift workspace
steps:
- name: Checkout
uses: actions/checkout@v4
- name: sdf compile step
uses: ./ # Uses an action in the root directory
id: sdf
with:
command: 'sdf compile --show all'
workspace_dir: 'workspace/tpch_redshift'
aws_region: 'us-west-2'
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Use the output from the `sdf` step
- name: Display the sdf output
run: |
echo "### SDF Run Logs 🪵" >> $GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY
echo "${{ steps.sdf.outputs.log }}" >>$GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY
finances_dbt:
runs-on: ubuntu-latest
name: xyz
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run DBT commands
uses: mwhitaker/dbt-action@master
env:
DBT_TARGET: dev
SNOWFLAKE_ACCOUNT_ID: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }}
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
with:
dbt_command: dbt deps && dbt compile"
dbt_project_folder: "workspace/finances_dbt"
- name: Run sdf compile
uses: ./ # Uses an action in the root directory
id: sdf
env:
CATALOG: dbt_hol_dev
SCHEMA: public
DBT_TARGET: dev
with:
# TODO: FIX compile failed
command: 'sdf compile'
workspace_dir: 'workspace/finances_dbt'
dbt_profile_dir: 'ci_profile'
is_dbt: 'true'
snowflake_account_id: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }}
snowflake_username: ${{ secrets.SNOWFLAKE_USERNAME }}
snowflake_password: ${{ secrets.SNOWFLAKE_PASSWORD }}
snowflake_role: 'dbt_test_role'
snowflake_warehouse: 'dbt_dev_wh'
# Use the output from the `sdf` step
- name: Display the sdf output
run: |
echo "### SDF Run Logs 🪵" >> $GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY
echo "${{ steps.sdf.outputs.log }}" >>$GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY
# dbt_init_challenge_v1 - uses dbt-action
dbt_init_challenge_v1:
runs-on: ubuntu-latest
name: Snowflake + dbt workspace - run dbt commands using dbt-action
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run DBT commands
uses: mwhitaker/dbt-action@master
env:
DBT_TARGET: dev
SNOWFLAKE_ACCOUNT_ID: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }}
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
with:
dbt_command: "dbt compile"
dbt_project_folder: "workspace/dbt_init_challenge"
- name: Run sdf push
uses: ./ # Uses an action in the root directory
id: sdf
env:
CATALOG: dbt_hol_dev
SCHEMA: public
DBT_TARGET: dev
with:
# TODO: FIX compile failed
command: 'sdf push'
workspace_dir: 'workspace/dbt_init_challenge'
access_key: ${{ secrets.ACCESS_KEY }}
secret_key: ${{ secrets.SECRET_KEY }}
is_dbt: 'true'
snowflake_account_id: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }}
snowflake_username: ${{ secrets.SNOWFLAKE_USERNAME }}
snowflake_password: ${{ secrets.SNOWFLAKE_PASSWORD }}
snowflake_role: 'dbt_test_role'
snowflake_warehouse: 'dbt_dev_wh'
# Use the output from the `sdf` step
- name: Display the sdf output
run: |
echo "### SDF Run Logs 🪵" >> $GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY
echo "${{ steps.sdf.outputs.log }}" >>$GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY
# dbt_init_challenge_v2: rus dbt commands in a container job
dbt_init_challenge_v2:
container:
image: ghcr.io/dbt-labs/dbt-snowflake:1.5.latest
volumes:
- ${{ github.workspace }}:/repo
runs-on: ubuntu-latest
name: Snowflake + dbt workspace - run dbt commands in a container job
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run DBT commands
env:
DBT_TARGET: dev
SNOWFLAKE_ACCOUNT_ID: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }}
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
run: |
cd /repo/workspace/dbt_init_challenge
dbt deps
dbt compile
- name: Run sdf push
uses: ./ # Uses an action in the root directory
id: sdf
env:
CATALOG: dbt_hol_dev
SCHEMA: public
DBT_TARGET: dev
with:
command: 'sdf push'
# relative path to ${{ github.workspace }} which is automatically mounted by GitHub Actions
workspace_dir: workspace/dbt_init_challenge
access_key: ${{ secrets.ACCESS_KEY }}
secret_key: ${{ secrets.SECRET_KEY }}
is_dbt: 'true'
snowflake_account_id: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }}
snowflake_username: ${{ secrets.SNOWFLAKE_USERNAME }}
snowflake_password: ${{ secrets.SNOWFLAKE_PASSWORD }}
snowflake_role: 'dbt_test_role'
snowflake_warehouse: 'dbt_dev_wh'
# Use the output from the `sdf` step
- name: Display the sdf output
run: |
echo "### SDF Run Logs 🪵" >> $GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY
echo "${{ steps.sdf.outputs.log }}" >>$GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY
snowflake:
container:
image: ghcr.io/dbt-labs/dbt-snowflake:1.5.latest
volumes:
- ${{ github.workspace }}:/repo
runs-on: ubuntu-latest
name: Snowflake workspace
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run sdf push
uses: ./ # Uses an action in the root directory
id: sdf
with:
# TODO: FIX compile failed
command: 'sdf push'
# relative path to ${{ github.workspace }} which is automatically mounted by GitHub Actions
workspace_dir: workspace/snowflake
access_key: ${{ secrets.ACCESS_KEY }}
secret_key: ${{ secrets.SECRET_KEY }}
snowflake_account_id: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }}
snowflake_username: ${{ secrets.SNOWFLAKE_USERNAME }}
snowflake_password: ${{ secrets.SNOWFLAKE_PASSWORD }}
snowflake_role: 'dbt_test_role'
snowflake_warehouse: 'dbt_dev_wh'
# Use the output from the `sdf` step
- name: Display the sdf output
run: |
echo "### SDF Run Logs 🪵" >> $GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY
echo "${{ steps.sdf.outputs.log }}" >>$GITHUB_STEP_SUMMARY
echo '```' >>$GITHUB_STEP_SUMMARY