added key pair auth test #70
This file contains 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: Test sdf-action | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
tpch_redshift: | |
runs-on: ubuntu-latest | |
name: Redshift workspace | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: sdf compile step | |
uses: ./ # Uses an action in the root directory | |
id: sdf | |
with: | |
command: "sdf compile --show all" | |
workspace_dir: "workspace/tpch_redshift" | |
aws_region: "us-west-2" | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# Use the output from the `sdf` step | |
- name: Display the sdf output | |
run: | | |
echo "### SDF Run Logs 🪵" >> $GITHUB_STEP_SUMMARY | |
echo '```' >>$GITHUB_STEP_SUMMARY | |
echo "${{ steps.sdf.outputs.log }}" >>$GITHUB_STEP_SUMMARY | |
echo '```' >>$GITHUB_STEP_SUMMARY | |
dbt_init_challenge: | |
container: | |
image: ghcr.io/dbt-labs/dbt-snowflake:1.8.latest | |
volumes: | |
- ${{ github.workspace }}:/repo | |
runs-on: ubuntu-latest | |
name: Snowflake + dbt workspace - run dbt commands in a container job | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run DBT commands | |
env: | |
DBT_TARGET: dev | |
SNOWFLAKE_ACCOUNT_ID: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }} | |
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }} | |
run: | | |
cd /repo/workspace/dbt_init_challenge | |
dbt deps | |
dbt compile | |
- name: Run sdf push | |
uses: ./ # Uses an action in the root directory | |
id: sdf | |
env: | |
CATALOG: dbt_hol_dev | |
SCHEMA: public | |
DBT_TARGET: dev | |
with: | |
command: "sdf push" | |
# relative path to ${{ github.workspace }} which is automatically mounted by GitHub Actions | |
workspace_dir: workspace/dbt_init_challenge | |
access_key: ${{ secrets.ACCESS_KEY }} | |
secret_key: ${{ secrets.SECRET_KEY }} | |
is_dbt: "true" | |
snowflake_account_id: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }} | |
snowflake_username: ${{ secrets.SNOWFLAKE_USERNAME }} | |
snowflake_password: ${{ secrets.SNOWFLAKE_PASSWORD }} | |
snowflake_role: "dbt_test_role" | |
snowflake_warehouse: "dbt_dev_wh" | |
# Use the output from the `sdf` step | |
- name: Display the sdf output | |
run: | | |
echo "### SDF Run Logs 🪵" >> $GITHUB_STEP_SUMMARY | |
echo '```' >>$GITHUB_STEP_SUMMARY | |
echo "${{ steps.sdf.outputs.log }}" >>$GITHUB_STEP_SUMMARY | |
echo '```' >>$GITHUB_STEP_SUMMARY | |
snowflake_password: | |
container: | |
image: ghcr.io/dbt-labs/dbt-snowflake:1.8.latest | |
volumes: | |
- ${{ github.workspace }}:/repo | |
runs-on: ubuntu-latest | |
name: Snowflake workspace with password auth | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run sdf push | |
uses: ./ # Uses an action in the root directory | |
id: sdf | |
with: | |
# TODO: FIX compile failed | |
command: "sdf push" | |
# relative path to ${{ github.workspace }} which is automatically mounted by GitHub Actions | |
workspace_dir: workspace/snowflake | |
access_key: ${{ secrets.ACCESS_KEY }} | |
secret_key: ${{ secrets.SECRET_KEY }} | |
snowflake_account_id: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }} | |
snowflake_username: ${{ secrets.SNOWFLAKE_USERNAME }} | |
snowflake_password: ${{ secrets.SNOWFLAKE_PASSWORD }} | |
snowflake_role: "dbt_test_role" | |
snowflake_warehouse: "dbt_dev_wh" | |
# Use the output from the `sdf` step | |
- name: Display the sdf output | |
run: | | |
echo "### SDF Run Logs 🪵" >> $GITHUB_STEP_SUMMARY | |
echo '```' >>$GITHUB_STEP_SUMMARY | |
echo "${{ steps.sdf.outputs.log }}" >>$GITHUB_STEP_SUMMARY | |
echo '```' >>$GITHUB_STEP_SUMMARY | |
snowflake_key_pair: | |
container: | |
image: ghcr.io/dbt-labs/dbt-snowflake:1.5.latest | |
volumes: | |
- ${{ github.workspace }}:/repo | |
runs-on: ubuntu-latest | |
name: Snowflake workspace with key pair auth | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run sdf push | |
uses: ./ # Uses an action in the root directory | |
id: sdf | |
with: | |
# TODO: FIX compile failed | |
command: 'sdf push' | |
# relative path to ${{ github.workspace }} which is automatically mounted by GitHub Actions | |
workspace_dir: workspace/snowflake | |
access_key: ${{ secrets.ACCESS_KEY }} | |
secret_key: ${{ secrets.SECRET_KEY }} | |
snowflake_account_id: ${{ secrets.SNOWFLAKE_ACCOUNT_ID }} | |
snowflake_username: ${{ secrets.SNOWFLAKE_USERNAME }} | |
snowflake_private_key_pem: ${{ secrets.SNOWFLAKE_PRIVATE_KEY_PEM }} | |
snowflake_role: 'dbt_test_role' | |
snowflake_warehouse: 'dbt_dev_wh' | |
# Use the output from the `sdf` step | |
- name: Display the sdf output | |
run: | | |
echo "### SDF Run Logs 🪵" >> $GITHUB_STEP_SUMMARY | |
echo '```' >>$GITHUB_STEP_SUMMARY | |
echo "${{ steps.sdf.outputs.log }}" >>$GITHUB_STEP_SUMMARY | |
echo '```' >>$GITHUB_STEP_SUMMARY |