Skip to content

Commit

Permalink
optimize cache in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Jan 30, 2023
1 parent ddecf09 commit d1dd2a2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,29 @@ permissions:
jobs:
quality:
name: Checking dependency graph
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-20.04']
python-version: ['3.8']

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.8
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8 # lint with minimal version supported (3.8 in 18.04)
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.wheel_dir
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
key: ${{ matrix.os }}-pip-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}
${{ matrix.os }}-pip-${{ matrix.python-version }}
- name: Install dependencies
run: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ permissions:
jobs:
quality:
name: Checking dependency graph and code quality
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-20.04']
python-version: ['3.8']

steps:
- uses: actions/checkout@v3
Expand All @@ -27,10 +31,10 @@ jobs:
test $(ls geotrek/*/migrations/*.py | xargs grep -l srid | xargs grep -L SRID | wc -l) -eq 0
- name: Set up Python 3.8
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8 # lint with minimal version supported (3.8 in 18.04)
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ jobs:
~/.cache/pip
~/.wheel_dir
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
key: ${{ matrix.os }}-pip-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}
${{ matrix.os }}-pip-${{ matrix.python-version }}
- name: Install System dependencies
run: |
Expand Down

0 comments on commit d1dd2a2

Please sign in to comment.