Skip to content

Commit

Permalink
use venv
Browse files Browse the repository at this point in the history
  • Loading branch information
jagapiou committed Jul 29, 2023
1 parent 90cdf3a commit a76e16d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-examples/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:

- name: Install requirements for examples
shell: bash
run: pip -r examples/requirements.txt
run: pip install -r examples/requirements.txt

- name: Show installed dependencies
shell: bash
Expand Down
46 changes: 30 additions & 16 deletions .github/actions/install-meltingpot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,52 @@ inputs:
runs:
using: composite
steps:
# - name: Get current runner
# id: get-runner
# shell: bash
# run: |
# echo "runner=$(uname -s)-$(uname -r)" >> $GITHUB_OUTPUT
- name: Get current runner
id: get-runner
shell: bash
run: |
echo "runner=$(uname -s)-$(uname -r)" >> $GITHUB_OUTPUT
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: ${{ inputs.python-version }}
cache: pip
cache-dependency-path: setup.py

- name: Restore assets
id: assets-restore
- name: Restore cached installation
id: cache-restore
uses: actions/cache/restore@v3

with:
path: assets
key: assets-${{ hashFiles('setup.py') }}
path: |
meltingpot/assets
venv
key: install-meltingpot-${{ steps.get-runner.outputs.runner }}-py${{ inputs.python-version}}-${{ hashFiles('setup.py') }}
restore-keys: |
assets-
install-meltingpot-${{ steps.get-runner.outputs.runner }}-py${{ inputs.python-version }}-
- name: Install Python dependencies
if: steps.cache-restore.outputs.cache-hit != 'true'
shell: bash
run: |
pip cache list
pip install --upgrade pip
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install --editable .[dev]
- name: Save assets
if: steps.assets-restore.outputs.cache-hit != 'true'
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v3

with:
path: assets
key: ${{ steps.assets-restore.outputs.cache-primary-key }}
path: |
meltingpot/assets
venv
key: ${{ steps.cache-restore.outputs.cache-primary-key }}

- name: Activate Virtual Environment
shell: bash
run: |
source venv/bin/activate
pip list
echo "PATH=${PATH}" >> $GITHUB_ENV

0 comments on commit a76e16d

Please sign in to comment.