From 4fd75c59fa1e1684431ad9140e8590023058189b Mon Sep 17 00:00:00 2001 From: Hironsan Date: Wed, 14 Dec 2022 14:51:37 +0900 Subject: [PATCH] Add testing installation step --- .github/workflows/pypi-publish.yml | 26 +++++++++++++++++--------- backend/cli.py | 3 +++ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index c67f2e95..642aba26 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -1,8 +1,9 @@ name: Upload Python Package -on: - release: - types: [created] +# on: +# release: +# types: [created] +on: [push, pull_request] jobs: deploy: @@ -45,9 +46,16 @@ jobs: run: | sed -e "s/, from = \"..\"//g" backend/pyproject.toml > pyproject.toml poetry build - - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: ${{ secrets.PYPI_USERNAME }} - password: ${{ secrets.PYPI_PASSWORD }} - packages_dir: ./dist/ + - name: Test installation + run: | + pip install dist/doccano*whl + doccano init + doccano createuser --username admin --password pass + doccano webserver & + sleep 10 + # - name: Publish a Python distribution to PyPI + # uses: pypa/gh-action-pypi-publish@master + # with: + # user: ${{ secrets.PYPI_USERNAME }} + # password: ${{ secrets.PYPI_PASSWORD }} + # packages_dir: ./dist/ diff --git a/backend/cli.py b/backend/cli.py index d531c64c..d45a814e 100644 --- a/backend/cli.py +++ b/backend/cli.py @@ -89,6 +89,9 @@ def command_migrate(args): def command_run_webserver(args): + import sys + + sys.exit(1) print(f"Starting server with port {args.port}.") if is_windows(): run_on_windows(args)