Skip to content

outside_contributor_dbt_v1.4.6_all_build_full_refresh #10

outside_contributor_dbt_v1.4.6_all_build_full_refresh

outside_contributor_dbt_v1.4.6_all_build_full_refresh #10

name: outside_contributor_dbt_v1.4.6_all_build_full_refresh
on:
workflow_dispatch:
inputs:
prNumber:
description: 'Pull Request Number'
required: true
env:
DBT_TUVA_SNOWFLAKE_ACCOUNT: ${{ secrets.DBT_TUVA_SNOWFLAKE_ACCOUNT }}
DBT_TUVA_CI_DATABASE: ${{ secrets.DBT_TUVA_CI_DATABASE }}
DBT_SNOWFLAKE_CI_PASSWORD: ${{ secrets.DBT_SNOWFLAKE_CI_PASSWORD }}
DBT_SNOWFLAKE_CI_ROLE: ${{ secrets.DBT_SNOWFLAKE_CI_ROLE }}
DBT_SNOWFLAKE_CI_SCHEMA: ${{ secrets.DBT_SNOWFLAKE_CI_SCHEMA }}
DBT_SNOWFLAKE_CI_USER: ${{ secrets.DBT_SNOWFLAKE_CI_USER }}
DBT_SNOWFLAKE_CI_WAREHOUSE: ${{ secrets.DBT_SNOWFLAKE_CI_WAREHOUSE }}
DBT_REDSHIFT_CI_HOST: ${{ secrets.DBT_REDSHIFT_CI_HOST }}
DBT_REDSHIFT_CI_USER: ${{ secrets.DBT_REDSHIFT_CI_USER }}
DBT_REDSHIFT_CI_PASSWORD: ${{ secrets.DBT_REDSHIFT_CI_PASSWORD }}
DBT_REDSHIFT_CI_PORT: ${{ secrets.DBT_REDSHIFT_CI_PORT }}
DBT_BIGQUERY_TOKEN: ${{ secrets.TUVA_BIGQUERY_TOKEN }}
TUVA_BIGQUERY_PROJECT: ${{ secrets.TUVA_BIGQUERY_PROJECT }}
jobs:
snowflake:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.inputs.prNumber }}/merge
- name: dbt-deps
uses: mwhitaker/[email protected]
with:
dbt_command: "dbt deps --profiles-dir ./profiles/snowflake"
dbt_project_folder: "integration_tests"
- name: dbt-debug
uses: mwhitaker/[email protected]
with:
dbt_command: "dbt debug --profiles-dir ./profiles/snowflake"
dbt_project_folder: "integration_tests"
- name: dbt-build
uses: mwhitaker/[email protected]
with:
dbt_command: 'dbt build --full-refresh --profiles-dir ./profiles/snowflake --vars {"tuva_database":"dev_ci_testing","input_database":"dev_ci_testing","input_schema":"claims_common"}'
dbt_project_folder: "integration_tests"
- name: Get the result
if: ${{ always() }}
run: echo "${{ steps.dbt-build.outputs.result }}"
shell: bash
redshift:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.inputs.prNumber }}/merge
- name: dbt-deps
uses: mwhitaker/[email protected]
with:
dbt_command: "dbt deps --profiles-dir ./profiles/redshift"
dbt_project_folder: "integration_tests"
- name: dbt-debug
uses: mwhitaker/[email protected]
with:
dbt_command: "dbt debug --profiles-dir ./profiles/redshift"
dbt_project_folder: "integration_tests"
- name: dbt-build
uses: mwhitaker/[email protected]
with:
dbt_command: 'dbt build --full-refresh --profiles-dir ./profiles/redshift --vars {"tuva_database":"dev_ci_testing","input_database":"dev_ci_testing","input_schema":"claims_common"}'
dbt_project_folder: "integration_tests"
- name: Get the result
if: ${{ always() }}
run: echo "${{ steps.dbt-build.outputs.result }}"
shell: bash
bigquery:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.inputs.prNumber }}/merge
- name: dbt-deps
uses: mwhitaker/[email protected]
with:
dbt_command: "dbt deps --profiles-dir ./profiles/bigquery"
dbt_project_folder: "integration_tests"
- name: dbt-debug
uses: mwhitaker/[email protected]
with:
dbt_command: "dbt debug --profiles-dir ./profiles/bigquery"
dbt_project_folder: "integration_tests"
- name: dbt-build
uses: mwhitaker/[email protected]
with:
dbt_command: 'dbt build --full-refresh --profiles-dir ./profiles/bigquery --vars {"tuva_database":"dev-ci-testing","input_database":"dev-ci-testing","input_schema":"connector"}'
dbt_project_folder: "integration_tests"
- name: Get the result
if: ${{ always() }}
run: echo "${{ steps.dbt-build.outputs.result }}"
shell: bash
post_status:
needs: [snowflake, redshift, bigquery]
if: always()
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Post comment on PR
run: |
PR_COMMENT="Workflow has finished with the following statuses:<ul><li>Snowflake: ${{ needs.snowflake.result }}</li></ul><ul><li>Redshift: ${{ needs.redshift.result }}</li></ul><ul><li>BigQuery: ${{ needs.bigquery.result }}</li></ul>"
PR_ID=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.inputs.prNumber }} --json number -q .number)
gh pr comment $PR_ID --body "$PR_COMMENT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}