Skip to content

Commit

Permalink
update workflows to run in the subpackage directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Dec 1, 2024
1 parent a7f2242 commit c84c2d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ concurrency:
defaults:
run:
shell: bash
working-directory: ./dbt-postgres

jobs:
code-quality:
Expand All @@ -45,9 +44,11 @@ jobs:
- name: Update Adapters and Core branches
if: ${{ contains(github.event_name, 'workflow_') }}
run: scripts/update_dev_packages.sh ${{ inputs.dbt_adapters_branch }} "main"
working-directory: ./dbt-postgres

- name: Setup `hatch`
uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main

- name: Run code quality
run: hatch run code-quality
working-directory: ./dbt-postgres
7 changes: 7 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ jobs:
${{ inputs.dbt_core_branch }} \
${{ inputs.dbt_common_branch }}
cat pyproject.toml
working-directory: ./dbt-postgres

- name: Setup postgres
run: psql -f ./scripts/setup_test_database.sql
working-directory: ./dbt-postgres
env:
PGHOST: localhost
PGPORT: 5432
Expand All @@ -134,6 +136,7 @@ jobs:

- name: Run integration tests
run: hatch run integration-tests
working-directory: ./dbt-postgres
env:
POSTGRES_TEST_HOST: localhost
POSTGRES_TEST_PORT: 5432
Expand Down Expand Up @@ -166,24 +169,28 @@ jobs:
- name: "Test psycopg2 name - default"
run: scripts/psycopg2-check.sh
working-directory: ./dbt-postgres
env:
PSYCOPG2_EXPECTED_NAME: psycopg2-binary

- name: "Test psycopg2 name - invalid override"
run: scripts/psycopg2-check.sh
working-directory: ./dbt-postgres
env:
DBT_PSYCOPG2_NAME: rubber-baby-buggy-bumpers
PSYCOPG2_EXPECTED_NAME: psycopg2-binary

- name: "Test psycopg2 name - override"
run: scripts/psycopg2-check.sh
working-directory: ./dbt-postgres
env:
DBT_PSYCOPG2_NAME: psycopg2
PSYCOPG2_EXPECTED_NAME: psycopg2-binary # we have not implemented the hook yet, so this doesn't work

- name: "Test psycopg2 name - manual override"
# verify that the workaround documented in the `README.md` continues to work
run: scripts/psycopg2-check.sh
working-directory: ./dbt-postgres
env:
PSYCOPG2_WORKAROUND: true
PSYCOPG2_EXPECTED_NAME: psycopg2
7 changes: 2 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }}
cancel-in-progress: true

defaults:
run:
shell: bash
working-directory: ./dbt-postgres

jobs:
unit:
name: Unit Tests
Expand All @@ -43,3 +38,5 @@ jobs:

- name: Run unit tests
run: hatch run unit-tests
shell: bash
working-directory: ./dbt-postgres

0 comments on commit c84c2d7

Please sign in to comment.