Skip to content

Commit

Permalink
Merge pull request #25 from godatadriven/pex-artifact
Browse files Browse the repository at this point in the history
Create pex artifact
  • Loading branch information
pgoslatara authored Jul 10, 2024
2 parents 6a5f6c9 + a803759 commit 40710f4
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 200 deletions.
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

0 comments on commit 40710f4

Please sign in to comment.