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/*"]
|
2022-06-17 02:31:32 +00:00
|
|
|
paths-ignore:
|
|
|
|
- "src/lightning_app/**" # todo: implement job skip
|
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:
|
2021-05-21 11:35:12 +00:00
|
|
|
os: [ubuntu-20.04, macOS-10.15, windows-2019]
|
2022-06-30 13:02:57 +00:00
|
|
|
pkg: ["app", "pytorch"]
|
2022-06-27 13:34:18 +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
|
|
|
|
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/
|
|
|
|
|
|
|
|
- uses: ./.github/actions/pkg-check
|
|
|
|
with:
|
|
|
|
pkg-name: ${{ matrix.pkg }}
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ci-packages-${{ github.sha }}
|
|
|
|
path: pypi
|
|
|
|
|
|
|
|
- name: Determine package name
|
|
|
|
if: ${{ inputs.pkg-import == '' }}
|
2022-06-27 13:34:18 +00:00
|
|
|
working-directory: ./dist
|
|
|
|
run: python -c "import glob ; ls = glob.glob('*.tar.gz') ; name = '_'.join(ls[0].split('-')[:-1]) ; print(f'PKG_NAME={name}')" >> $GITHUB_ENV
|
2020-08-07 07:08:23 +00:00
|
|
|
|
2022-06-30 13:02:57 +00:00
|
|
|
- uses: ./.github/actions/pkg-install
|
|
|
|
with:
|
|
|
|
pkg-name: ${{ env.PKG_NAME }}
|
|
|
|
|
|
|
|
install-meta:
|
|
|
|
needs: install-standalone
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
# max-parallel: 1
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-20.04, macOS-10.15, windows-2019]
|
|
|
|
pkg: ["", "lightning"]
|
|
|
|
python-version: [3.7] # , 3.9
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
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/"
|