Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/pydantic-2.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pgoslatara authored Sep 9, 2024
2 parents 0ad80e2 + a092ac8 commit c930968
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 78 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,16 @@ jobs:
poetry-version: ${{ env.POETRY_VERSION }}
python-version: ${{ matrix.python-version }}

- name: Run pytest (Windows)
if: matrix.operating-system == 'windows-latest'
run: make test-windows

- name: Run pytest (unit tests)
if: matrix.operating-system != 'windows-latest'
run: make test-unit | tee pytest-coverage.txt && exit ${PIPESTATUS[0]}

- name: Pytest coverage comment
if: matrix.python-version == '3.11' && matrix.operating-system == 'ubuntu-latest'
if: matrix.python-version == '3.11' && matrix.operating-system != 'windows-latest'
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
Expand All @@ -96,16 +101,25 @@ jobs:
junitxml-path: ./coverage.xml

- name: Run pytest (integration tests)
if: matrix.operating-system != 'windows-latest'
run: make test-integration

- name: Regenerate dbt artifacts
- name: Regenerate dbt artifacts and run `dbt-bouncer`
if: matrix.operating-system == 'windows-latest'
run: |
$env:Path += ';C:\Users\runneradmin\.local\bin'
poetry run dbt deps
poetry run dbt build
poetry run dbt docs generate
poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml
- name: Run `dbt-bouncer` on generated artifacts
run: poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml
- name: Regenerate dbt artifacts and run `dbt-bouncer`
if: matrix.operating-system != 'windows-latest'
run: |
poetry run dbt deps
poetry run dbt build
poetry run dbt docs generate
poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml
e2e-tests:
needs: [pre-commit]
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/merge_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
- name: Run `dbt-bouncer`
run: python ./dist/dbt-bouncer.pex --config-file dbt-bouncer-example.yml

pypi-tests:
pip-tests:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
Expand All @@ -141,13 +141,6 @@
- name: Checkout
uses: actions/checkout@v4

- name: Determine python version
id: python-version
run: |
export PYTHON_VERSION=$(cat .python-version)
echo "PYTHON_VERSION: $PYTHON_VERSION"
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_OUTPUT
- name: Setup Python
uses: ./.github/actions/setup_python_env
with:
Expand All @@ -160,11 +153,19 @@
- name: Run `dbt-bouncer`
run: dbt-bouncer --config-file dbt-bouncer-example.yml

- name: Regenerate dbt artifacts
- name: Regenerate dbt artifacts and run `dbt-bouncer`
if: matrix.operating-system == 'windows-latest'
run: |
$env:Path += ';C:\Users\runneradmin\.local\bin'
poetry run dbt deps
poetry run dbt build
poetry run dbt docs generate
poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml
- name: Run `dbt-bouncer` on generated artifacts
run: poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml
- name: Regenerate dbt artifacts and run `dbt-bouncer`
if: matrix.operating-system != 'windows-latest'
run: |
poetry run dbt deps
poetry run dbt build
poetry run dbt docs generate
poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml
26 changes: 16 additions & 10 deletions .github/workflows/post_release_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,30 +96,36 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Determine python version
id: python-version
run: |
export PYTHON_VERSION=$(cat .python-version)
echo "PYTHON_VERSION: $PYTHON_VERSION"
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_OUTPUT
- name: Setup Python
uses: ./.github/actions/setup_python_env
with:
poetry-version: ${{ env.POETRY_VERSION }}
python-version: ${{ matrix.python-version }}

- name: Install `dbt-bouncer`
if: matrix.operating-system == 'windows-latest'
run: pip install dbt-bouncer=='("${{ github.ref }}" -Split "/")[2]'

- name: Install `dbt-bouncer`
if: matrix.operating-system != 'windows-latest'
run: pip install dbt-bouncer==$(echo "${{ github.ref }}" | cut -d "/" -f3)

- name: Run `dbt-bouncer`
run: dbt-bouncer --config-file dbt-bouncer-example.yml

- name: Regenerate dbt artifacts
- name: Regenerate dbt artifacts and run `dbt-bouncer`
if: matrix.operating-system == 'windows-latest'
run: |
$env:Path += ';C:\Users\runneradmin\.local\bin'
poetry run dbt deps
poetry run dbt build
poetry run dbt docs generate
poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml
- name: Run `dbt-bouncer` on generated artifacts
run: poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml
- name: Regenerate dbt artifacts and run `dbt-bouncer`
if: matrix.operating-system != 'windows-latest'
run: |
poetry run dbt deps
poetry run dbt build
poetry run dbt docs generate
poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml
111 changes: 58 additions & 53 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
build-artifacts:
poetry run python ./scripts/generate_artifacts.py

build-pex:
poetry run pex . \
--interpreter-constraint ">=3.8.1,<3.13" \
--jobs 128 \
--max-install-jobs 0 \
--output-file ./dist/dbt-bouncer.pex \
--pip-version 23.2 \
--platform macosx_11_0_x86_64-cp-38-cp38 \
--platform macosx_11_0_x86_64-cp-39-cp39 \
--platform macosx_11_0_x86_64-cp-310-cp310 \
--platform macosx_11_0_x86_64-cp-311-cp311 \
--platform macosx_11_0_x86_64-cp-312-cp312 \
--platform manylinux2014_x86_64-cp-38-cp38 \
--platform manylinux2014_x86_64-cp-39-cp39 \
--platform manylinux2014_x86_64-cp-310-cp310 \
--platform manylinux2014_x86_64-cp-311-cp311 \
--platform manylinux2014_x86_64-cp-312-cp312 \
--python-shebang='/usr/bin/env python' \
--script dbt-bouncer

test:
$(MAKE) test-unit
$(MAKE) test-integration

test-integration:
poetry run pytest \
-c ./tests \
--junitxml=coverage.xml \
--cov-report=term-missing:skip-covered \
--cov=src/dbt_bouncer/ \
--numprocesses 5 \
./tests/integration \
$(MAKE_ARGS)

test-unit:
poetry run pytest \
-c ./tests \
--junitxml=coverage.xml \
--cov-report=term-missing:skip-covered \
--cov=src/dbt_bouncer/ \
--numprocesses 5 \
./tests/unit \
-m 'not not_in_parallel' && \
poetry run pytest \
-c ./tests \
--junitxml=coverage.xml \
--cov-report=term-missing:skip-covered \
--cov=src/dbt_bouncer/ \
--cov-append \
-m not_in_parallel
build-artifacts:
poetry run python ./scripts/generate_artifacts.py

build-pex:
poetry run pex . \
--interpreter-constraint ">=3.8.1,<3.13" \
--jobs 128 \
--max-install-jobs 0 \
--output-file ./dist/dbt-bouncer.pex \
--pip-version 23.2 \
--platform macosx_11_0_x86_64-cp-38-cp38 \
--platform macosx_11_0_x86_64-cp-39-cp39 \
--platform macosx_11_0_x86_64-cp-310-cp310 \
--platform macosx_11_0_x86_64-cp-311-cp311 \
--platform macosx_11_0_x86_64-cp-312-cp312 \
--platform manylinux2014_x86_64-cp-38-cp38 \
--platform manylinux2014_x86_64-cp-39-cp39 \
--platform manylinux2014_x86_64-cp-310-cp310 \
--platform manylinux2014_x86_64-cp-311-cp311 \
--platform manylinux2014_x86_64-cp-312-cp312 \
--python-shebang='/usr/bin/env python' \
--script dbt-bouncer

test:
$(MAKE) test-unit
$(MAKE) test-integration

test-integration:
poetry run pytest \
-c ./tests \
--junitxml=coverage.xml \
--cov-report=term-missing:skip-covered \
--cov=src/dbt_bouncer/ \
--numprocesses 5 \
./tests/integration \
$(MAKE_ARGS)

test-unit:
poetry run pytest \
-c ./tests \
--junitxml=coverage.xml \
--cov-report=term-missing:skip-covered \
--cov=src/dbt_bouncer/ \
--numprocesses 5 \
./tests/unit \
-m 'not not_in_parallel' && \
poetry run pytest \
-c ./tests \
--junitxml=coverage.xml \
--cov-report=term-missing:skip-covered \
--cov=src/dbt_bouncer/ \
--cov-append \
-m not_in_parallel

test-windows:
poetry run pytest -c ./tests --numprocesses 5 ./tests/unit -m 'not not_in_parallel' && \
poetry run pytest -c ./tests -m not_in_parallel && \
poetry run pytest -c ./tests --numprocesses 5 ./tests/integration

0 comments on commit c930968

Please sign in to comment.