Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test requirements in pyproject.toml via bash script #15

Merged
merged 11 commits into from
Feb 20, 2024
17 changes: 17 additions & 0 deletions .github/scripts/update_dev_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -e
set -e


adapters_git_branch=$1
core_git_branch=$2
target_req_file="pyproject.toml"
core_req_sed_pattern="s|dbt-core.git.*#subdirectory=core|dbt-core.git@${core_git_branch}#subdirectory=core|g"
adapters_req_sed_pattern="s|dbt-adapters.git|dbt-adapters.git@${adapters_git_branch}|g"
if [[ "$OSTYPE" == darwin* ]]; then
# mac ships with a different version of sed that requires a delimiter arg
sed -i "" "$core_req_sed_pattern" $target_req_file
sed -i "" "$adapters_req_sed_pattern" $target_req_file
else
sed -i "$core_req_sed_pattern" $target_req_file
sed -i "$adapters_req_sed_pattern" $target_req_file
fi
24 changes: 23 additions & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ on:
- "*.latest"
pull_request:
workflow_dispatch:
inputs:
dbt_adapters_branch:
inputs:
colin-rogers-dbt marked this conversation as resolved.
Show resolved Hide resolved
description: "The branch of dbt-adapters to evaluate"
type: string
required: true
mikealfare marked this conversation as resolved.
Show resolved Hide resolved
default: "main"
workflow_call:
inputs:
dbt_adapters_branch:
description: "The branch of dbt-adapters to evaluate"
type: string
required: true
default: "main"

permissions: read-all

Expand All @@ -26,8 +40,16 @@ jobs:
with:
persist-credentials: false

- name: Update Adapters and Core branches
if: ${{ github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch'}}
shell: bash
run: |
./.github/scripts/update_dev_packages.sh \
${{ github.event.inputs.dbt_adapters_branch }} \
"main"

- name: Setup `hatch`
uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main
uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@${{ inputs.dbt_adapters_branch }}
mikealfare marked this conversation as resolved.
Show resolved Hide resolved

- name: Run linters
run: hatch run lint:all
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ on:
- "*.latest"
pull_request:
workflow_dispatch:
inputs:
dbt_adapters_branch:
description: "The branch of dbt-adapters to use"
type: string
required: false
default: "main"
core_branch:
description: "The branch of dbt-core to use"
type: string
required: false
default: "main"
workflow_call:
inputs:
dbt_adapters_branch:
description: "The branch of dbt-adapters to use"
type: string
required: false
default: "main"
core_branch:
description: "The branch of dbt-core to use"
type: string
required: false
default: "main"


permissions: read-all

Expand Down Expand Up @@ -42,6 +66,14 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Update Adapters and Core branches
if: ${{ github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch'}}
shell: bash
run: |
./.github/scripts/update_dev_packages.sh \
${{ github.event.inputs.dbt_adapters_branch }} \
${{ github.event.inputs.core_branch }}

- name: Setup postgres
shell: bash
run: psql -f ./scripts/setup_test_database.sql
Expand Down
Loading