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
|
|
|
|
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-08-10 09:02:54 +00:00
|
|
|
os: [ubuntu-20.04, macOS-11, 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:
|
2020-11-04 09:08:37 +00:00
|
|
|
- uses: actions/checkout@v2
|
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-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-08-10 09:02:54 +00:00
|
|
|
os: [ubuntu-20.04, macOS-11, 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:
|
|
|
|
- uses: actions/checkout@v2
|
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
|
|
|
|
if: ${{ matrix.pkg != '' }}
|
|
|
|
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
|
|
|
|
|
|
|
install-meta-pypi:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
# max-parallel: 1
|
|
|
|
matrix:
|
2022-08-10 09:02:54 +00:00
|
|
|
os: [ubuntu-20.04, macOS-11, windows-2022]
|
2022-07-11 21:46:10 +00:00
|
|
|
python-version: [3.8] # , 3.9
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
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: |
|
|
|
|
pip install -q fire requests
|
|
|
|
for pkg in 'app' 'pytorch' ; do
|
|
|
|
python .actions/assistant.py download-package "$pkg" --folder pypi
|
|
|
|
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: |
|
|
|
|
pip install -q fire requests
|
|
|
|
python .actions/assistant.py mirror-pkg2source pypi src
|
|
|
|
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/"
|