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

Create pex artifact #25

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,46 @@ jobs:
uses: ./
with:
dbt-project-dir: dbt_project

pex-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
id: setup-python
uses: actions/setup-python@v5

- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v4
with:
path: /home/runner/.local
key: poetry-cache-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ env.POETRY_VERSION }}

- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
installer-parallel: true
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-ansi

- name: Build pex file
run: poetry run pex . -c dbt-bouncer -o dbt-bouncer.pex

- name: Test pex file
run: ./dbt-bouncer.pex --dbt-project-dir dbt_project
8 changes: 8 additions & 0 deletions .github/workflows/release_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
- name: Re-install dbt-bouncer
run: poetry install

- name: Build pex file
run: poetry run pex . -c dbt-bouncer -o dbt-bouncer.pex

- name: Save version to env var
id: version
run: |
Expand Down Expand Up @@ -154,3 +157,8 @@
--title 'v${{ steps.version.outputs.version }}' \
$PRELEASE \
--verify-tag

- name: Upload .pex to release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload v${{ steps.version.outputs.version }} dbt-bouncer.pex
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,4 @@ dbt_project/target/perf_info.json
dbt_project/target/run_results.json
dbt_project/target/semantic_manifest.json
dbt_project/.user.yml
dbt-bouncer.pex
Loading