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

Creating GitHub Action #8

Merged
merged 1 commit into from
Jun 30, 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
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 }}