2021-11-10 16:59:10 +00:00
|
|
|
name: Package
|
2020-06-27 20:25:33 +00:00
|
|
|
|
|
|
|
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
2020-09-10 22:38:29 +00:00
|
|
|
on: # Trigger the workflow on push or pull request, but only for the master branch
|
2020-06-27 20:25:33 +00:00
|
|
|
push:
|
2021-01-12 12:56:20 +00:00
|
|
|
branches: [master, "release/*"]
|
2020-06-27 20:25:33 +00:00
|
|
|
pull_request:
|
2020-11-04 09:08:37 +00:00
|
|
|
branches: [master, "release/*"]
|
2020-06-27 20:25:33 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2021-11-10 16:59:10 +00:00
|
|
|
install:
|
2020-06-27 20:25:33 +00:00
|
|
|
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]
|
2020-06-27 20:25:33 +00:00
|
|
|
|
|
|
|
steps:
|
2020-11-04 09:08:37 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-06-27 20:25:33 +00:00
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
2020-08-07 07:08:23 +00:00
|
|
|
python-version: ${{ matrix.python-version }}
|
2020-06-27 20:25:33 +00:00
|
|
|
|
2020-10-18 18:40:18 +00:00
|
|
|
- name: Prepare env
|
|
|
|
run: |
|
2021-11-19 14:38:42 +00:00
|
|
|
pip install "twine==3.2" setuptools wheel
|
2020-10-18 18:40:18 +00:00
|
|
|
|
2020-06-27 20:25:33 +00:00
|
|
|
- name: Create package
|
|
|
|
run: |
|
2021-11-19 14:38:42 +00:00
|
|
|
python setup.py check --metadata --strict
|
2021-01-12 12:56:20 +00:00
|
|
|
python setup.py sdist bdist_wheel
|
2020-06-27 20:25:33 +00:00
|
|
|
|
2020-08-07 07:08:23 +00:00
|
|
|
- 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
|
2020-10-20 22:53:10 +00:00
|
|
|
pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
|
2020-08-07 07:08:23 +00:00
|
|
|
|
2021-01-12 12:56:20 +00:00
|
|
|
- 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
|
2020-06-27 20:25:33 +00:00
|
|
|
run: |
|
2021-01-12 12:56:20 +00:00
|
|
|
# install as wheel
|
|
|
|
pip install dist/*.whl
|
|
|
|
cd ..
|
|
|
|
python -c "import pytorch_lightning as pl ; print(pl.__version__)"
|
2021-04-15 07:36:04 +00:00
|
|
|
pip uninstall -y pytorch-lightning
|