Skip to content

Commit

Permalink
Create metrics_ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Jstein77 authored May 8, 2024
1 parent 0e48e6e commit da809a6
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/metrics_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Metrics Validation

on:
push:
branches:
- main # Change this to the branch you want to trigger the action on
pull_request:
branches:
- main # Change this to the branch you want to trigger the action on

jobs:
setup-dbt-cloud-profile:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9.16'

- name: Install dbt
run: |
pip install dbt
- name: Set up dbt Cloud profile
run: |
mkdir -p ~/.dbt
echo 'outputs:' > ~/.dbt/profiles.yml
echo ' dev:' >> ~/.dbt/profiles.yml
echo ' account: kw27752' >> ~/.dbt/profiles.yml
echo ' database: ANALYTICS' >> ~/.dbt/profiles.yml
echo ' password: ${{ secrets.DBT_CLOUD_TOKEN_NAME }}' >> ~/.dbt/profiles.yml
echo ' role: TRANSFORMER' >> ~/.dbt/profiles.yml
echo ' schema: dbt_gh_ci' >> ~/.dbt/profiles.yml
echo ' threads: 8' >> ~/.dbt/profiles.yml
echo ' type: snowflake' >> ~/.dbt/profiles.yml
echo ' user: DBT_SEMANTIC_LAYER_TEST' >> ~/.dbt/profiles.yml
echo ' warehouse: ANALYTICS' >> ~/.dbt/profiles.yml
echo 'target: dev' >> ~/.dbt/profiles.yml
- name: Set up dbt Cloud config
run: |
mkdir -p ~/.dbt
echo 'version: "1"' > ~/.dbt/dbt_cloud.yml
echo 'context:' >> ~/.dbt/dbt_cloud.yml
echo ' active-host: "cloud.getdbt.com"' >> ~/.dbt/dbt_cloud.yml
echo ' active-project: "263759"' >> ~/.dbt/dbt_cloud.yml
echo 'projects:' >> ~/.dbt/dbt_cloud.yml
echo ' - project-name: "Semantic Layer Demo"' >> ~/.dbt/dbt_cloud.yml
echo ' project-id: "263759"' >> ~/.dbt/dbt_cloud.yml
echo ' account-name: "Community DX Sandbox"' >> ~/.dbt/dbt_cloud.yml
echo ' account-id: "78663"' >> ~/.dbt/dbt_cloud.yml
echo ' account-host: "cloud.getdbt.com"' >> ~/.dbt/dbt_cloud.yml
echo ' token-name: ${{ secrets.DBT_CLOUD_TOKEN_NAME }}' >> ~/.dbt/dbt_cloud.yml
echo ' token-value: ${{ secrets.DBT_CLOUD_TOKEN_VALUE }}' >> ~/.dbt/dbt_cloud.yml
- name: Verify dbt Cloud profile
run: |
cat ~/.dbt/profiles.yml
cat ~/.dbt/dbt_cloud.yml
dbt debug --profiles-dir ~/.dbt
- name: Run Modified Models
run: |
dbt run -s state:modified

0 comments on commit da809a6

Please sign in to comment.