-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae48e67
commit 223dbd1
Showing
280 changed files
with
588 additions
and
1,204 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "Code quality" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: "Choose the branch to check" | ||
type: string | ||
default: "main" | ||
repository: | ||
description: "Choose the repository to check, when using a fork" | ||
type: string | ||
default: "dbt-labs/dbt-postgres" | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
package: dbt-postgres | ||
|
||
jobs: | ||
code-quality: | ||
uses: dbt-labs/dbt-adapters/.workflows/_code-quality.yml@monorepo-prep | ||
with: | ||
package: ${{ env.package }} | ||
branch: ${{ inputs.branch }} | ||
repository: ${{ inputs.repository }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
name: "Integration tests" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
description: "Choose the branch to test" | ||
type: string | ||
default: "main" | ||
repository: | ||
description: "Choose the repository to test, when using a fork" | ||
type: string | ||
default: "dbt-labs/dbt-athena" | ||
os: | ||
description: "Choose the OS to test against" | ||
type: string | ||
default: ${{ vars.DEFAULT_RUNNER }} | ||
python-version: | ||
description: "Choose the Python version to test against" | ||
type: string | ||
default: ${{ vars.DEFAULT_PYTHON_VERSION }} | ||
dbt-core-branch: | ||
description: "Choose the branch of dbt-core to use" | ||
type: string | ||
default: "main" | ||
dbt-common-branch: | ||
description: "Choose the branch of dbt-common to use" | ||
type: string | ||
default: "main" | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: "Choose the branch to test" | ||
type: string | ||
default: "main" | ||
repository: | ||
description: "Choose the repository to test, when using a fork" | ||
type: string | ||
default: "dbt-labs/dbt-athena" | ||
os: | ||
description: "Choose the OS to test against" | ||
type: string | ||
default: ${{ vars.DEFAULT_RUNNER }} | ||
python-version: | ||
description: "Choose the Python version to test against" | ||
type: choice | ||
options: ["3.9", "3.10", "3.11", "3.12"] | ||
dbt-core-branch: | ||
description: "Choose the branch of dbt-core to use" | ||
type: string | ||
default: "main" | ||
dbt-common-branch: | ||
description: "Choose the branch of dbt-common to use" | ||
type: string | ||
default: "main" | ||
|
||
permissions: read-all | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
integration: | ||
name: Integration Tests | ||
runs-on: ${{ inputs.os }} | ||
env: | ||
POSTGRES_TEST_HOST: localhost | ||
POSTGRES_TEST_PORT: 5432 | ||
POSTGRES_TEST_USER: root | ||
POSTGRES_TEST_PASS: password | ||
POSTGRES_TEST_DATABASE: dbt | ||
POSTGRES_TEST_THREADS: 4 | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: ${{ env.POSTGRES_TEST_PASS }} | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
repository: ${{ inputs.repository }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
- uses: pypa/hatch@install | ||
- run: | | ||
./.github/scripts/update_dev_dependency_branches.sh \ | ||
${{ inputs.dbt-core-branch }} \ | ||
${{ inputs.dbt-common-branch }} | ||
cat pyproject.toml | ||
- run: psql -f ./scripts/setup_test_database.sql | ||
env: | ||
PGHOST: ${{ env.POSTGRES_TEST_HOST }} | ||
PGPORT: ${{ env.POSTGRES_TEST_PORT }} | ||
PGUSER: ${{ env.POSTGRES_TEST_USER }} | ||
PGPASSWORD: ${{ env.POSTGRES_TEST_PASS }} | ||
PGDATABASE: ${{ env.POSTGRES_TEST_DATABASE }} | ||
- run: hatch run integration-tests | ||
working-directory: ./dbt-postgres | ||
|
||
psycopg2-check: | ||
name: "Test psycopg2 build version" | ||
runs-on: ${{ inputs.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
# no override | ||
- expected: psycopg2-binary | ||
# invalid override | ||
- input: rubber-baby-buggy-bumpers | ||
expected: psycopg2-binary | ||
# we have not implemented the hook yet, so this doesn't work | ||
- input: psycopg2 | ||
expected: psycopg2-binary | ||
# verify that the workaround documented in the `README.md` continues to work | ||
- workaround: true | ||
expected: psycopg2 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
repository: ${{ inputs.repository }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
- run: brew install postgresql | ||
if: ${{ runner == 'macos-14' }} | ||
- run: .github/scripts/psycopg2-check.sh | ||
env: | ||
DBT_PSYCOPG2_NAME: ${{ matrix.input }} | ||
PSYCOPG2_WORKAROUND: ${{ matrix.workaround }} | ||
PSYCOPG2_EXPECTED_NAME: ${{ matrix.expected }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: "Publish Internally" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
deploy-to: | ||
description: "Choose whether to publish to test or prod" | ||
type: string | ||
default: "test" | ||
branch: | ||
description: "Choose the branch to publish" | ||
type: string | ||
default: "main" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
publish-internal: | ||
uses: dbt-labs/dbt-adapters/.github/workflows/_publish-internal.yml@monorepo-prep | ||
with: | ||
package: "dbt-postgres" | ||
deploy-to: ${{ inputs.deploy-to }} | ||
branch: ${{ inputs.branch }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Publish to PyPI" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
deploy-to: | ||
description: "Choose whether to publish to test or prod" | ||
type: environment | ||
default: "test" | ||
branch: | ||
description: "Choose the branch to publish" | ||
type: string | ||
default: "main" | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
publish: | ||
uses: dbt-labs/dbt-adapters/.github/workflows/_publish-pypi.yml@monorepo-prep | ||
with: | ||
package: "dbt-postgres" | ||
deploy-to: ${{ inputs.deploy-to }} | ||
branch: ${{ inputs.branch }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Unit tests" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: "Choose the branch to test" | ||
type: string | ||
default: "main" | ||
repository: | ||
description: "Choose the repository to test, when using a fork" | ||
type: string | ||
default: "dbt-labs/dbt-postgres" | ||
os: | ||
description: "Choose the OS to test against" | ||
type: string | ||
default: ${{ vars.DEFAULT_RUNNER }} | ||
python-version: | ||
description: "Choose the Python version to test against" | ||
type: choice | ||
options: ["3.9", "3.10", "3.11", "3.12"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
unit-tests: | ||
uses: dbt-labs/dbt-adapters/.github/workflows/_unit-tests.yml@monorepo-prep | ||
with: | ||
package: "dbt-postgres" | ||
branch: ${{ inputs.branch }} | ||
repository: ${{ inputs.repository }} | ||
os: ${{ inputs.os }} | ||
python-version: ${{ inputs.python-version }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.