Skip to content

Commit

Permalink
cache python setup step
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedBasem20 committed Mar 6, 2024
1 parent c99f674 commit da0a315
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ jobs:
algorithms: ${{ steps.algorithms.outputs.algorithms }}
steps:
- uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ runner.tool_cache }}/Python/3.11
key: ${{ runner.tool_cache }}/Python/$3.11/${{ runner.arch }}-${{ hashFiles('requirements.txt') }}
- name: Set up Python
id: setup_python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'
- name: Cache pip
uses: actions/cache@v3
id: pip-cache
with:
key: ${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ${{ env.pythonLocation }}
if: steps.python-cache.outputs.cache-hit != 'true'

- name: Install dependencies
run: |
Expand Down Expand Up @@ -55,18 +53,15 @@ jobs:
SNR: [10, 30, 50, 100, 200]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'
- name: Cache pip
id: python-cache
uses: actions/cache@v3

- name: Restore python cache
uses: actions/[email protected]
id: restore_cache
with:
key: ${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ${{ env.pythonLocation }}
if: steps.python-cache.outputs.cache-hit != 'true'
path: ${{ runner.tool_cache }}/Python/3.11
key: ${{ runner.tool_cache }}/Python/$3.11/${{ runner.arch }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.tool_cache }}/Python/$3.11/${{ runner.arch }}-

- name: Generate fitting data
run: |
Expand Down

0 comments on commit da0a315

Please sign in to comment.