outside_contributor_dbt_v1.6.3_all_build_full_refresh #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: outside_contributor_dbt_v1.6.3_all_build_full_refresh | |
on: | |
workflow_dispatch: | |
inputs: | |
prNumber: | |
description: 'Pull Request Number' | |
required: true | |
env: | |
DBT_SNOWFLAKE_CI_ACCOUNT: ${{ secrets.DBT_SNOWFLAKE_CI_ACCOUNT }} | |
DBT_SNOWFLAKE_CI_DATABASE: ${{ secrets.DBT_SNOWFLAKE_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 }} | |
DBT_BIGQUERY_CI_PROJECT: ${{ secrets.DBT_BIGQUERY_CI_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/dbt-action@v1.6.3 | |
with: | |
dbt_command: "dbt deps --profiles-dir ./integration_tests/profiles/snowflake" | |
- name: dbt-debug | |
uses: mwhitaker/dbt-action@v1.6.3 | |
with: | |
dbt_command: "dbt debug --profiles-dir ./integration_tests/profiles/snowflake" | |
- name: dbt-build | |
uses: mwhitaker/dbt-action@v1.6.3 | |
with: | |
dbt_command: 'dbt build --full-refresh --profiles-dir ./integration_tests/profiles/snowflake --vars {"tuva_database":"dev_ci_testing","input_database":"dev_ci_testing","input_schema":"saf","tuva_schema_prefix":"saf"}' | |
- 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/dbt-action@v1.6.3 | |
with: | |
dbt_command: "dbt deps --profiles-dir ./integration_tests/profiles/redshift" | |
- name: dbt-debug | |
uses: mwhitaker/dbt-action@v1.6.3 | |
with: | |
dbt_command: "dbt debug --profiles-dir ./integration_tests/profiles/redshift" | |
- name: dbt-build | |
uses: mwhitaker/dbt-action@v1.6.3 | |
with: | |
dbt_command: 'dbt build --full-refresh --profiles-dir ./integration_tests/profiles/redshift --vars {"tuva_database":"dev_ci_testing","input_database":"dev_ci_testing","input_schema":"saf","tuva_schema_prefix":"saf"}' | |
- 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/dbt-action@v1.6.3 | |
with: | |
dbt_command: "dbt deps --profiles-dir ./integration_tests/profiles/bigquery" | |
- name: dbt-debug | |
uses: mwhitaker/dbt-action@v1.6.3 | |
with: | |
dbt_command: "dbt debug --profiles-dir ./integration_tests/profiles/bigquery" | |
- name: dbt-build | |
uses: mwhitaker/dbt-action@v1.6.3 | |
with: | |
dbt_command: 'dbt build --full-refresh --profiles-dir ./integration_tests/profiles/bigquery --vars {"tuva_database":"dev-ci-testing","input_database":"dev-ci-testing","input_schema":"lds","tuva_schema_prefix":"lds"}' | |
- 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 }} |