Skip to content

Commit

Permalink
Merge pull request #26 from godatadriven/add-pex-repo
Browse files Browse the repository at this point in the history
Migrating action to a pex file
  • Loading branch information
pgoslatara authored Jul 11, 2024
2 parents 40710f4 + a6e19c2 commit 01ad9e8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
run: poetry install --no-interaction --no-ansi

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

- name: Test pex file
run: ./dbt-bouncer.pex --dbt-project-dir dbt_project
run: ./dist/dbt-bouncer.pex --dbt-project-dir dbt_project
4 changes: 2 additions & 2 deletions .github/workflows/release_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
run: poetry install

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

- name: Save version to env var
id: version
Expand Down Expand Up @@ -161,4 +161,4 @@
- name: Upload .pex to release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload v${{ steps.version.outputs.version }} dbt-bouncer.pex
run: gh release upload v${{ steps.version.outputs.version }} ./dist/dbt-bouncer.pex
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ __pycache__/
.Python
build/
develop-eggs/
dist/
# dist/
downloads/
eggs/
.eggs/
Expand Down Expand Up @@ -173,4 +173,3 @@ 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
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
exclude: '^dist'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand Down Expand Up @@ -39,3 +40,11 @@ repos:
rev: v0.21.3
hooks:
- id: sqlfmt
- repo: local
hooks:
- id: build-pex
entry: poetry
args: ['run', 'pex', '.', '-c', 'dbt-bouncer', '-o', './dist/dbt-bouncer.pex']
language: system
name: Build .pex
pass_filenames: false
15 changes: 9 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ inputs:
default: '.'
description: 'Directory where your dbt project is located.'
required: false

runs:
using: 'docker'
image: 'Dockerfile'
args:
- dbt-bouncer
- --dbt-project-dir
- /github/workspace/${{ inputs.dbt-project-dir }}
using: 'composite'

steps:
- name: Run dbt-bouncer
shell: bash
run: |
${{ github.action_path }}/dist/dbt-bouncer.pex \
--dbt-project-dir ${{ inputs.dbt-project-dir }}
Binary file added dist/dbt-bouncer.pex
Binary file not shown.

0 comments on commit 01ad9e8

Please sign in to comment.