Skip to content

Commit

Permalink
Cache pip without setup-python
Browse files Browse the repository at this point in the history
  • Loading branch information
henry2004y committed Oct 14, 2024
1 parent 8730cc6 commit 132727c
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,15 @@ jobs:
- x64
steps:
- uses: actions/checkout@v4
- name: Hack setup-python cache
# Create an empty requirements.txt if this file (or pyproject.toml) doesn't exist.
# This has been reported at: https://github.com/actions/setup-python/issues/807
# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762
# or https://github.com/actions/setup-python/issues/751
if: hashFiles('**/requirements.txt', '**/pyproject.toml') == ''
run: |
touch ./requirements.txt
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip' # caching pip dependencies
python-version: '3'
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- run: pip install matplotlib
shell: bash
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
Expand All @@ -62,19 +58,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Hack setup-python cache
# Create an empty requirements.txt if this file (or pyproject.toml) doesn't exist.
# This has been reported at: https://github.com/actions/setup-python/issues/807
# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762
# or https://github.com/actions/setup-python/issues/751
if: hashFiles('**/requirements.txt', '**/pyproject.toml') == ''
run: |
touch ./requirements.txt
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip' # caching pip dependencies
python-version: '3'
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- run: pip install matplotlib
shell: bash
- uses: julia-actions/setup-julia@v2
with:
version: '1'
Expand Down

0 comments on commit 132727c

Please sign in to comment.