Skip to content

Commit

Permalink
Merge pull request #3993 from GeotrekCE/hotfix_cache_ci
Browse files Browse the repository at this point in the history
fix CI cache
  • Loading branch information
submarcos authored Mar 12, 2024
2 parents a411f84 + 203a4d9 commit f896045
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
8 changes: 6 additions & 2 deletions .github/actions/python-cache-requirements/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
cache: 'pip'
cache-dependency-path: '**/*requirements.txt'
cache-dependency-path: |
requirements.txt
dev-requirements.txt
docs/requirements.txt
- run: |
pip install -r ${{ inputs.requirements }}
shell: bash
27 changes: 8 additions & 19 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
paths:
- setup.py
- requirements.txt
- dev-requirements.in
- dev-requirements.txt
- docs/requirements.txt
- .github/workflows/dependencies.yml

env:
Expand All @@ -25,39 +25,28 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
- uses: ./.github/actions/python-cache-requirements
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.wheel_dir
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/*requirements.txt') }}
restore-keys: |
pip-${{ matrix.python-version }}-${{ hashFiles('**/*requirements.txt') }}
requirements: dev-requirements.txt

- name: Install dependencies
run: |
pip3 wheel --wheel-dir=~/.wheel_dir pip wheel setuptools
pip3 install --find-links=~/.wheel_dir --upgrade pip wheel setuptools
pip3 wheel --wheel-dir=~/.wheel_dir pip-tools -c dev-requirements.txt
pip3 install --find-links=~/.wheel_dir --upgrade pip-tools -c dev-requirements.txt
pip3 install -c dev-requirements.txt pip-tools
- name: Check dependency graph
run: |
pip-compile -q
pip-compile -q dev-requirements.in
pip-compile -q docs/requirements.in
- name: Verify dependency graph is ok
uses: tj-actions/verify-changed-files@v17
id: verify-changed-files
with:
files: |
requirements.txt
dev-requirements.txt
requirements.txt
dev-requirements.txt
docs/requirements.txt
- name: Validating graph
if: steps.verify-changed-files.outputs.files_changed == 'true'
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,12 @@ jobs:
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.wheel_dir
./venv
key: pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'dev-requirements.txt', 'docs/requirements.txt') }}
key: pip-${{ matrix.python-version }}-${{ matrix.os }}-${{ hashFiles('./requirements.txt', './dev-requirements.txt', './docs/requirements.txt') }}
restore-keys: |
pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'dev-requirements.txt', 'docs/requirements.txt') }}
pip-${{ matrix.python-version }}-${{ matrix.os }}-${{ hashFiles('./requirements.txt', './dev-requirements.txt', './docs/requirements.txt') }}
pip-${{ matrix.python-version }}-${{ matrix.os }}
- name: Prepare test env
run: |
Expand Down

0 comments on commit f896045

Please sign in to comment.