66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
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/*"]
|
|
|
|
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:
|
|
os: [ubuntu-20.04, macOS-10.15, windows-2019]
|
|
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
|