-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (45 loc) · 1.22 KB
/
dbt_run_on_merge.yaml
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
name: dbt CI pipeline
on:
push:
branches:
- main
pull_request:
branches:
- "*"
env:
DBT_ACCOUNT_ID: ${{ secrets.DBT_ACCOUNT_ID }}
DBT_PROJECT_ID: ${{ secrets.DBT_PROJECT_ID }}
DBT_PR_JOB_ID: ${{ secrets.DBT_JOB_ID }}
DBT_API_KEY: ${{ secrets.DBT_API_KEY }}
DBT_JOB_CAUSE: 'GitHub Pipeline CI Job'
DBT_JOB_BRANCH: ${{ github.ref }}
jobs:
ci-tests:
name: dbt run and test CI checks
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Decode keyfile
run: echo "${{ secrets.KEYS_JSON }}" | base64 -d > keyfile.json
- name: Set up environment variables
run: |
export KEY_FILE="keyfile.json"
echo "KEY_FILE=$KEY_FILE" >> $GITHUB_ENV
- name: Install dbt dependencies
run: |
pip install --upgrade pip
pip install dbt
pip install dbt-bigquery --force-reinstall
pip install dbt-core
- name: Install dbt dependencies
run: dbt deps
- name: Run Tests
run: dbt test
- name: Build dbt Project
run: dbt build