Skip to content

Commit

Permalink
Merge pull request #131 from fizyk/cache-pipfile.lock-and-deps
Browse files Browse the repository at this point in the history
Cache Pipfile.lock and pipenv dependencies - closes #129
  • Loading branch information
fizyk authored Sep 8, 2023
2 parents 3d6899e + 0ed6776 commit d1321d4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/actions/pipenv/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,33 @@ runs:
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: pipenv
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v2
with:
files: "Pipfile.lock"
- name: Restore Pipfile.lock if not in git
if: steps.check_files.outputs.files_exists == 'false'
uses: actions/cache@v3
id: loadcache
with:
path: Pipfile.lock
key: pipfile-lock-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('Pipfile') }}
- name: Install pipenv and dependencies
shell: bash
run: |
python -m pip install --upgrade pip pipenv
pipenv --python $(which python)
pipenv run python --version
pipenv install --dev ${{ inputs.pipenv-install-options }}
- name: Cache Pipfile.lock if not in git
if: steps.check_files.outputs.files_exists == 'false'
uses: actions/cache/save@v3
id: cache
with:
path: Pipfile.lock
key: pipfile-lock-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('Pipfile') }}
- name: Run ${{ inputs.command }}
shell: bash
run: pipenv run ${{ inputs.command }}
3 changes: 3 additions & 0 deletions newsfragments/129.feature.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Cache `Pipfile.lock` if it's not versioned in git -
this will help provide reproducible builds, and allows
to remove `--skip-lock` flags from pipenv install commands..
1 change: 1 addition & 0 deletions newsfragments/129.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cache pipenv dependencies

0 comments on commit d1321d4

Please sign in to comment.