Skip to content

Commit

Permalink
feat: add lfs checkout for django projects
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandro-mariotti-zupit committed Nov 8, 2023
1 parent 5e27c00 commit b7c255c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/django-step-lint-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ on:
required: false
type: string
default: ""
ENABLE_LFS:
required: false
type: boolean
default: false

env: "${{secrets}}"

Expand All @@ -50,6 +54,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
if: ${{ inputs.ENABLE_LFS == 'true' }}
with:
lfs: 'true'
- name: Setup
run: ${{ inputs.SETUP_COMMANDS }}
- name: Install dependencies
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/django-step-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
required: false
type: string
default: ""
ENABLE_LFS:
required: false
type: boolean
default: false

env: "${{secrets}}"

Expand All @@ -48,6 +52,9 @@ jobs:

steps:
- uses: actions/checkout@v3
if: ${{ inputs.ENABLE_LFS == 'true' }}
with:
lfs: 'true'
- name: Setup
run: ${{ inputs.SETUP_COMMANDS }}
- name: Install dependencies
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/django-workflow-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ on:
required: false
type: string
default: ""

ENABLE_LFS:
required: false
type: boolean
default: false
jobs:
django-lint-check:
uses:
Expand All @@ -45,6 +48,7 @@ jobs:
RUN: ${{inputs.RUN}}
DJANGO_MIGRATIONS_CHECK_APPS: ${{inputs.DJANGO_MIGRATIONS_CHECK_APPS}}
SETUP_COMMANDS: ${{inputs.SETUP_COMMANDS}}
ENABLE_LFS: ${{inputs.ENABLE_LFS}}
secrets: inherit

django-tests:
Expand All @@ -57,4 +61,5 @@ jobs:
COVERAGE_ARTIFACT_NAME: ${{ inputs.COVERAGE_ARTIFACT_NAME }}
RUN: ${{inputs.RUN}}
SETUP_COMMANDS: ${{ inputs.SETUP_COMMANDS }}
ENABLE_LFS: ${{inputs.ENABLE_LFS}}
secrets: inherit
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,7 @@ In addition, it is possible to specify this optional input:
- **RUN**: Whether to run all the inside workflows or not. This is useful when you want to skip checks since the code didn't change. By default, it is **true**.
- **DJANGO_MIGRATIONS_CHECK_APPS**: The Django apps on which to run migration checks.
- **SETUP_COMMANDS**: Allow to execute commands before the download of the dependencies. Useful to install packages required for Python dependencies.
- **ENABLE_LFS**: To enable Git LFS support on checkout

This is an example to show how data should be formatted.

Expand Down

0 comments on commit b7c255c

Please sign in to comment.