Skip to content

Commit

Permalink
ci: use builtin python action cache for pipenv (#796)
Browse files Browse the repository at this point in the history
## 🔧 Problem

Python builds in Github actions seem to [fail randomly on Github
Actions](https://github.com/MTES-MCT/ecobalyse/actions/runs/11256209104/job/31297541397).


![image](https://github.com/user-attachments/assets/d9e62f70-d724-440b-9c80-32dc5513639c)

## 🍰 Solution

Try to use the now builtin [cache feature of the python github
action](https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages)
to fix the problem.


## 🏝️ How to test

The CI should be green on this PR.
  • Loading branch information
vjousse authored Oct 9, 2024
1 parent 3bcc269 commit 6be9410
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pipenv'

- name: Cache node_modules
id: cache-node_modules
Expand All @@ -49,12 +50,6 @@ jobs:
key: elm-cache-${{ hashFiles('elm.json') }}
restore-keys: elm-cache-

- name: Cache pipenv virtualenv
uses: actions/cache@v4
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}

- name: Install Node dependencies
run: npm ci --prefer-offline --no-audit

Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/score_history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pipenv'


- name: Cache node_modules
id: cache-node_modules
Expand All @@ -53,14 +55,6 @@ jobs:
key: elm-cache-${{ hashFiles('elm.json') }}
restore-keys: elm-cache-

- name: Cache pipenv virtualenv
uses: actions/cache@v4
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-${{ matrix.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-
- name: Install Node dependencies
run: npm ci --prefer-offline --no-audit

Expand Down

0 comments on commit 6be9410

Please sign in to comment.