Skip to content

feat: add cost_optimization_features to dbtcloud_job, fix CI/Merge SAO and deferral bugs (closes #664) #1427

feat: add cost_optimization_features to dbtcloud_job, fix CI/Merge SAO and deferral bugs (closes #664)

feat: add cost_optimization_features to dbtcloud_job, fix CI/Merge SAO and deferral bugs (closes #664) #1427

Workflow file for this run

on:
pull_request_target:
branches:
- main
merge_group:
branches:
- main
schedule:
# every sunday at 2:45 AM so we catch up issues that might not have been raised yet
- cron: '45 2 * * 0'
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pull-requests: write
name: dbt Cloud Integration Tests
jobs:
check-changie:
if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')"
runs-on: ubuntu-latest
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'cloud-tests' || '' }}
steps:
- name: Checkout code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
with:
fetch-depth: 0
- name: Debug refs
run: |
git remote -v
git branch -a
git log --oneline --decorate --graph --all -n 20
- name: Check for changie changes
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
git fetch origin $BASE_REF
git fetch origin pull/$PR_NUMBER/head:pr_branch
echo "Comparing changes between origin/$BASE_REF and pr_branch..."
if ! git diff --name-only origin/$BASE_REF...pr_branch | grep -q "^.changes/"; then
echo "::error::No changie changes detected. Please add a changelog entry using changie. https://changie.dev/guide/quick_start/"
exit 1
fi
fi
unit:
if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')"
needs: check-changie
runs-on: ubuntu-latest
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'cloud-tests' || '' }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.target == 'test-acceptance' || github.ref }}
cancel-in-progress: false
strategy:
matrix:
target:
- check-docs
- test
- test-acceptance
steps:
- name: pull_request actions/checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@19bb51245e9c80abacb2e91cc42b33fa478b8639 # actions/setup-go@v4
with:
go-version: '>=1.17.0'
- name: Install dependencies
run: make setup
# we install Terraform beforehand, otherwise each test requires downloading it
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # hashicorp/setup-terraform@v3
- name: make ${{ matrix.target }}
run: make ${{ matrix.target }}
env:
DBT_CLOUD_ACCOUNT_ID: ${{ secrets.TEST_DBT_CLOUD_ACCOUNT_ID }}
DBT_CLOUD_TOKEN: ${{ secrets.TEST_DBT_CLOUD_TOKEN }}
DBT_CLOUD_HOST_URL: ${{ secrets.TEST_DBT_CLOUD_HOST_URL }}
DBT_ACCEPTANCE_TEST_LINEAGE_INTEGRATION: ${{ secrets.DBT_ACCEPTANCE_TEST_LINEAGE_INTEGRATION }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_ACCOUNT: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_ACCOUNT }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_DATABASE: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_DATABASE }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_WAREHOUSE: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_WAREHOUSE }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_USER: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_USER }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_PASSWORD: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_PASSWORD }}
DBT_ACCEPTANCE_TEST_SNOWFLAKE_ROLE: ${{ secrets.DBT_ACCEPTANCE_TEST_SNOWFLAKE_ROLE }}
DBT_ACCEPTANCE_TEST_DATABRICKS_HOST: ${{ secrets.DBT_ACCEPTANCE_TEST_DATABRICKS_HOST }}
DBT_ACCEPTANCE_TEST_DATABRICKS_HTTP_PATH: ${{ secrets.DBT_ACCEPTANCE_TEST_DATABRICKS_HTTP_PATH }}
DBT_ACCEPTANCE_TEST_DATABRICKS_TOKEN: ${{ secrets.DBT_ACCEPTANCE_TEST_DATABRICKS_TOKEN }}
DBT_ACCEPTANCE_TEST_DATABRICKS_CATALOG: ${{ secrets.DBT_ACCEPTANCE_TEST_DATABRICKS_CATALOG }}