diff --git a/.github/workflows/ci_pipeline.yml b/.github/workflows/ci_pipeline.yml index 776ac85b..613e47c2 100644 --- a/.github/workflows/ci_pipeline.yml +++ b/.github/workflows/ci_pipeline.yml @@ -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 diff --git a/.github/workflows/release_pipeline.yml b/.github/workflows/release_pipeline.yml index a7fc7f74..d4a82c8b 100644 --- a/.github/workflows/release_pipeline.yml +++ b/.github/workflows/release_pipeline.yml @@ -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 @@ -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 diff --git a/.gitignore b/.gitignore index 045fe081..3b4533ba 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ __pycache__/ .Python build/ develop-eggs/ -dist/ +# dist/ downloads/ eggs/ .eggs/ @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5eb9e38b..7ddbb20b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,5 @@ --- +exclude: '^dist' repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 @@ -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 diff --git a/action.yml b/action.yml index 0490b28b..bc850188 100644 --- a/action.yml +++ b/action.yml @@ -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 }} diff --git a/dist/dbt-bouncer.pex b/dist/dbt-bouncer.pex new file mode 100755 index 00000000..905b6feb Binary files /dev/null and b/dist/dbt-bouncer.pex differ