-
Notifications
You must be signed in to change notification settings - Fork 4
34 lines (34 loc) · 1.15 KB
/
test_dbt_model.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
---
name: Test DBT model
on:
pull_request:
types: [labeled, opened]
branches: [main]
paths: [models/**, .github/workflows/test_dbt_model.yaml]
jobs:
test_dbt_model:
if: contains(github.event.pull_request.labels.*.name, 'test-dev-model')
name: Test DBT dev model
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Get all changed files using a comma separator
id: changed-files
uses: tj-actions/changed-files@v35
with:
separator: ','
- name: Set up poetry
run: pipx install poetry
- name: Set up python
uses: actions/setup-python@v4
with:
cache: poetry
python-version: '3.9'
- name: Install requirements
run: poetry install --only=dev
- name: Run script to test DBT model
run: |-
poetry run python .github/workflows/scripts/table_test.py --modified-files ${{ steps.changed-files.outputs.all_modified_files }} --graphql-url ${{ secrets.BACKEND_GRAPHQL_URL }} --prefect-backend-token ${{ secrets.PREFECT_BACKEND_TOKEN }}