forked from dbt-labs/jaffle-sl-template
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.69 KB
/
ci.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
name: CI
on: pull_request
jobs:
dbt-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
- name: Set up Snowflake profile
env:
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }}
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_DATABASE: ${{ secrets.SNOWFLAKE_DATABASE }}
SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }}
SNOWFLAKE_ROLE: ${{ secrets.SNOWFLAKE_ROLE }}
run: |
mkdir -p ~/.dbt/
echo "snowflake:" >> ~/.dbt/profiles.yml
echo " target: dev" >> ~/.dbt/profiles.yml
echo " outputs:" >> ~/.dbt/profiles.yml
echo " dev:" >> ~/.dbt/profiles.yml
echo " type: snowflake" >> ~/.dbt/profiles.yml
echo " account: $SNOWFLAKE_ACCOUNT" >> ~/.dbt/profiles.yml
echo " user: $SNOWFLAKE_USER" >> ~/.dbt/profiles.yml
echo " password: $SNOWFLAKE_PASSWORD" >> ~/.dbt/profiles.yml
echo " role: $SNOWFLAKE_ROLE" >> ~/.dbt/profiles.yml
echo " database: $SNOWFLAKE_DATABASE" >> ~/.dbt/profiles.yml
echo " warehouse: $SNOWFLAKE_WAREHOUSE" >> ~/.dbt/profiles.yml
echo " schema: dbt_metrics_ci" >> ~/.dbt/profiles.yml
- name: Install dbt Dependencies
run: dbt deps
- name: Instantiate Jaffle Shop data
run: dbt seed
- name: dbt Build
run: dbt build