Skip to content

Commit

Permalink
Merge pull request #8 from godatadriven/github-action
Browse files Browse the repository at this point in the history
Creating GitHub Action
  • Loading branch information
pgoslatara authored Jun 30, 2024
2 parents 497d064 + 25134c3 commit 989077f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ jobs:
- name: Run e2e test
run: |
docker run --rm \
--volume "$PWD/dbt_project":/app/dbt_project \
--volume "$PWD/dbt_project":/dbt_project \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:ci \
poetry run dbt_bouncer --dbt-project-dir dbt_project
github-action:
needs: [pre-commit]
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run action
uses: ./
with:
dbt-project-dir: dbt_project
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
ARG PYTHON_VERSION
FROM python:${PYTHON_VERSION}-slim
# Keep in sync with .python-version
FROM python:3.11.5-slim

# https://python-poetry.org/docs#ci-recommendations
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_VERSION=1.7.1 \
POETRY_HOME=/opt/poetry \
POETRY_VENV=/opt/poetry-venv
POETRY_VENV=/opt/poetry-venv \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_VIRTUALENVS_IN_PROJECT=true

# Creating a virtual environment just for poetry and install it with pip
RUN python3 -m venv $POETRY_VENV \
Expand All @@ -16,7 +18,7 @@ RUN python3 -m venv $POETRY_VENV \
# Add Poetry to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"

WORKDIR /app
# WORKDIR /app

# Copy Dependencies
COPY poetry.lock pyproject.toml README.md ./
Expand Down
14 changes: 14 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'dbt-bouncer'
description: 'Configure and enforce conventions for your dbt project.'
inputs:
dbt-project-dir:
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 }}

0 comments on commit 989077f

Please sign in to comment.