lightning/.github/actions/pkg-install/action.yml

43 lines
1.4 KiB
YAML

name: Install and validate the package
description: Install and validate the package
inputs:
pkg-folder:
description: Define folder with packages
required: true
pkg-name:
description: Package name to import
required: true
pip-flags:
description: Additional pip install flags
required: false
default: ""
runs:
using: "composite"
steps:
- name: Choose package import
working-directory: ${{ inputs.pkg-folder }}
run: |
ls -l
python -c "print('PKG_IMPORT=' + {'app': 'lightning_app', 'fabric': 'lightning_fabric', 'pytorch': 'pytorch_lightning'}.get('${{matrix.pkg-name}}', 'lightning'))" >> $GITHUB_ENV
python -c "import glob ; ls = glob.glob('*.tar.gz') ; print('PKG_SOURCE=' + ls[0])" >> $GITHUB_ENV
python -c "import glob ; ls = glob.glob('*.whl') ; print('PKG_WHEEL=' + ls[0])" >> $GITHUB_ENV
shell: bash
- name: Install package - wheel
working-directory: ${{ inputs.pkg-folder }}
run: |
pip install ${PKG_WHEEL} ${{ inputs.pip-flags }}
pip list | grep lightning
python -c "import ${{ env.PKG_IMPORT }}; print(${{ env.PKG_IMPORT }}.__version__)"
shell: bash
- name: Install package - archive
working-directory: ${{ inputs.pkg-folder }}
run: |
pip install ${PKG_SOURCE} ${{ inputs.pip-flags }}
pip list | grep lightning
python -c "import ${{ env.PKG_IMPORT }}; print(${{ env.PKG_IMPORT }}.__version__)"
shell: bash