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

Rewriting the action.yml to no longer use the DOCKERFILE #6

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ RUN apt-get update &&\

WORKDIR /github/workspace

ENTRYPOINT [ "pre-commit" ]
ENTRYPOINT exec pre-commit
26 changes: 22 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,26 @@ inputs:
description: 'pre-commit args'
required: false
default: 'run --all-files'

runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.args}}
using: "composite"
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install pre-commit and dbt
run: |
pip install --no-cache-dir pre-commit==2.18.0 \
dbt-core==1.0.0 \
dbt-postgres==1.0.0 \
dbt-redshift==1.0.0 \
dbt-snowflake==1.0.0 \
dbt-bigquery==1.0.0
Comment on lines +24 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to install every connector? And all version 1.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this action can be used to run some dbt commands via the hooks, ie dbt-test, I believe we need the connectors for that. Maybe we should be installing the latest version of dbt though, any thoughts on that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, ideally we would need to install every connector and it could be passed as a config. For now, however, I think it's probably fine to keep it like this and install them here. I'd bump to 1.2 for all of them though just to be closer to latest

pre-commit install-hooks
shell: bash

- name: Run pre-commit hooks
run: pre-commit ${{ inputs.args }}
shell: bash