lightning/.github/workflows/ci_pkg-install.yml

66 lines
1.9 KiB
YAML
Raw Normal View History

name: Package
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
2022-02-02 19:48:15 +00:00
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
jobs:
install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# max-parallel: 6
matrix:
2021-05-21 11:35:12 +00:00
os: [ubuntu-20.04, macOS-10.15, windows-2019]
2021-12-21 17:06:15 +00:00
python-version: [3.7, 3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Prepare env
run: |
pip install "twine==3.2" setuptools wheel
- name: Create package
run: |
python setup.py check --metadata --strict
python setup.py sdist bdist_wheel
- name: Check package
run: |
twine check dist/*
python setup.py clean
- name: Setup Windows
if: runner.os == 'windows'
run: |
# this is just a hotfix because of Win cannot install it directly
pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
- name: Install | Uninstall package - archive
run: |
# install as archive
pip install dist/*.tar.gz
cd ..
python -c "import pytorch_lightning as pl ; print(pl.__version__)"
pip uninstall -y pytorch-lightning
- name: Install | Uninstall package - wheel
run: |
# install as wheel
pip install dist/*.whl
cd ..
python -c "import pytorch_lightning as pl ; print(pl.__version__)"
pip uninstall -y pytorch-lightning