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

Migrating action to a pex file #26

Merged
merged 1 commit into from
Jul 11, 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
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.