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
|
2022-09-08 13:29:28 +00:00
|
|
|
on:
|
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
|
|
|
|
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/')) }}
|
|
|
|
|
2022-06-27 13:34:18 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2020-06-27 20:25:33 +00:00
|
|
|
jobs:
|
|
|
|
|
2022-06-30 13:02:57 +00:00
|
|
|
init-temp:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- run: mkdir pypi && touch pypi/.placeholder
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ci-packages-${{ github.sha }}
|
|
|
|
path: pypi
|
|
|
|
|
|
|
|
install-standalone:
|
|
|
|
needs: init-temp
|
2020-06-27 20:25:33 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2022-06-30 13:02:57 +00:00
|
|
|
fail-fast: true
|
|
|
|
max-parallel: 1
|
2020-06-27 20:25:33 +00:00
|
|
|
matrix:
|
2022-09-13 18:03:49 +00:00
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macOS-11, macOS-12, windows-2022]
|
2022-09-01 22:13:12 +00:00
|
|
|
pkg: ["app", "lite", "pytorch"]
|
2022-07-11 21:46:10 +00:00
|
|
|
python-version: [3.8] # , 3.9
|
2020-06-27 20:25:33 +00:00
|
|
|
|
|
|
|
steps:
|
2022-09-05 17:13:08 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-01 16:59:48 +00:00
|
|
|
- uses: actions/setup-python@v4
|
2020-06-27 20:25:33 +00:00
|
|
|
with:
|
2020-08-07 07:08:23 +00:00
|
|
|
python-version: ${{ matrix.python-version }}
|
2020-06-27 20:25:33 +00:00
|
|
|
|
2022-09-29 23:56:56 +00:00
|
|
|
- name: DocTests actions
|
|
|
|
working-directory: .actions/
|
|
|
|
run: |
|
|
|
|
grep 'pytest>' ../requirements/pytorch/test.txt | xargs -0 pip install
|
2022-10-19 19:05:23 +00:00
|
|
|
python -m pytest setup_tools.py
|
2022-09-29 23:56:56 +00:00
|
|
|
|
2022-06-30 13:02:57 +00:00
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ci-packages-${{ github.sha }}
|
|
|
|
path: pypi
|
|
|
|
- run: ls -lh pypi/
|
|
|
|
|
2022-09-05 13:18:38 +00:00
|
|
|
- run: python -c "print('NB_DIRS=' + str(2 if '${{ matrix.pkg }}' == 'pytorch' else 1))" >> $GITHUB_ENV
|
2022-06-30 13:02:57 +00:00
|
|
|
- uses: ./.github/actions/pkg-check
|
|
|
|
with:
|
|
|
|
pkg-name: ${{ matrix.pkg }}
|
2022-09-05 13:18:38 +00:00
|
|
|
nb-dirs: ${{ env.NB_DIRS }}
|
2022-06-30 13:02:57 +00:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ci-packages-${{ github.sha }}
|
|
|
|
path: pypi
|
|
|
|
|
|
|
|
- uses: ./.github/actions/pkg-install
|
|
|
|
|
2022-07-11 21:46:10 +00:00
|
|
|
install-meta-src:
|
2022-06-30 13:02:57 +00:00
|
|
|
needs: install-standalone
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
# max-parallel: 1
|
|
|
|
matrix:
|
2022-09-13 18:03:49 +00:00
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macOS-11, macOS-12, windows-2022]
|
2022-06-30 13:02:57 +00:00
|
|
|
pkg: ["", "lightning"]
|
2022-07-11 21:46:10 +00:00
|
|
|
python-version: [3.8] # , 3.9
|
2022-06-30 13:02:57 +00:00
|
|
|
|
|
|
|
steps:
|
2022-09-05 17:13:08 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-01 16:59:48 +00:00
|
|
|
- uses: actions/setup-python@v4
|
2022-06-30 13:02:57 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- run: mkdir -p pypi
|
|
|
|
- uses: actions/download-artifact@v3
|
2022-10-18 22:55:00 +00:00
|
|
|
if: matrix.pkg != ''
|
2022-06-30 13:02:57 +00:00
|
|
|
with:
|
|
|
|
name: ci-packages-${{ github.sha }}
|
|
|
|
path: pypi
|
|
|
|
- run: ls -lh pypi/
|
|
|
|
|
|
|
|
- uses: ./.github/actions/pkg-check
|
|
|
|
with:
|
|
|
|
pkg-name: ${{ matrix.pkg }}
|
|
|
|
|
|
|
|
- uses: ./.github/actions/pkg-install
|
|
|
|
with:
|
|
|
|
pkg-name: "lightning"
|
|
|
|
pip-flags: "-U --pre --find-links ../pypi/"
|
2022-07-11 21:46:10 +00:00
|
|
|
|
2022-09-13 02:45:32 +00:00
|
|
|
- name: Run CLI
|
|
|
|
run: python -m lightning --version
|
|
|
|
|
2022-07-11 21:46:10 +00:00
|
|
|
install-meta-pypi:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
# max-parallel: 1
|
|
|
|
matrix:
|
2022-09-13 18:03:49 +00:00
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macOS-11, macOS-12, windows-2022]
|
2022-07-11 21:46:10 +00:00
|
|
|
python-version: [3.8] # , 3.9
|
|
|
|
|
|
|
|
steps:
|
2022-09-05 17:13:08 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-01 16:59:48 +00:00
|
|
|
- uses: actions/setup-python@v4
|
2022-07-11 21:46:10 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Dowload package
|
2022-09-01 22:13:12 +00:00
|
|
|
# todo: download also lite after it is fist published
|
2022-07-11 21:46:10 +00:00
|
|
|
run: |
|
2022-09-09 18:38:03 +00:00
|
|
|
pip install -q -r .actions/requirements.txt
|
2022-07-11 21:46:10 +00:00
|
|
|
for pkg in 'app' 'pytorch' ; do
|
2022-10-20 18:23:47 +00:00
|
|
|
python .actions/assistant.py download_package --package "$pkg" --folder pypi
|
2022-07-11 21:46:10 +00:00
|
|
|
done
|
|
|
|
ls -lh pypi/
|
|
|
|
|
|
|
|
- name: Unzip packages
|
|
|
|
working-directory: pypi
|
|
|
|
run: for file in `ls *.gz`; do tar -xzf $file; done
|
|
|
|
- name: Show upacked pkgs
|
|
|
|
if: runner.os == 'linux'
|
|
|
|
run: |
|
|
|
|
sudo apt install -y tree
|
|
|
|
tree pypi/ -L 3
|
|
|
|
|
|
|
|
- name: Miror source
|
|
|
|
run: |
|
2022-09-09 18:38:03 +00:00
|
|
|
pip install -q -r .actions/requirements.txt
|
2022-10-20 18:23:47 +00:00
|
|
|
python .actions/assistant.py mirror_pkg2source --pypi_folder pypi --src_folder src
|
2022-07-11 21:46:10 +00:00
|
|
|
ls -R src/
|
|
|
|
|
2022-07-14 15:27:53 +00:00
|
|
|
- uses: ./.github/actions/pkg-check
|
|
|
|
with:
|
|
|
|
pkg-name: "lightning"
|
|
|
|
|
|
|
|
- uses: ./.github/actions/pkg-install
|
|
|
|
with:
|
|
|
|
pkg-name: "lightning"
|
2022-08-01 08:00:01 +00:00
|
|
|
pip-flags: "-U --pre --find-links ../pypi/"
|
2022-09-13 02:45:32 +00:00
|
|
|
|
|
|
|
- name: Run CLI
|
|
|
|
run: python -m lightning --version
|