Merge pull request #540 from dbt-labs/537-panic-crash-attempting-to-m… #1050
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
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 | |
steps: | |
- name: Checkout code | |
uses: 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 | |
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@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: 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@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 }} |