61 lines (51 loc) · 1.75 KB
/
ci_pkg-install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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/*"]
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.6, 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