diff --git a/.github/actions/install-meltingpot/action.yml b/.github/actions/install-meltingpot/action.yml index fa5375bd6..dfb7f01cf 100644 --- a/.github/actions/install-meltingpot/action.yml +++ b/.github/actions/install-meltingpot/action.yml @@ -10,11 +10,11 @@ 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 @@ -23,20 +23,25 @@ runs: 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') }} - restore-keys: | - assets- + path: | + meltingpot/assets + venv + key: install-meltingpot-${{ steps.get-runner.outputs.runner }}-py${{ inputs.python-version}}-${{ hashFiles('setup.py') }} + restore-keys: + install-meltingpot-${{ steps.get-runner.outputs.runner }}-py${{ inputs.python-version }} - name: Install Python dependencies + if: steps.assets-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 @@ -44,4 +49,11 @@ runs: uses: actions/cache/save@v3 with: path: assets - key: ${{ steps.assets-restore.outputs.cache-primary-key }} + 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