-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split web server into separate package (#98)
* Split web server into separate package - Eliminated npm part in setup.py commands - Created separate package TODO - rename to helics_cli_extras - move observer stuff to helics_cli_extras - move testing if necessary - setup ci/cd and PyPI package * Run formatter * Add CI for web * Move folder * Rename in setup.py * Rename in cli.py and improve test * Stop duplication of push and pull request * Move observer and database into cli_extras * Fix imports on observer and change ci-web to ci-cli.yml * .github/workflows/ci-cli.yml * Rename and create cd * Add NPM and environment name * Fix cd-cli-extras.yml * Run on workflow dispatch * Fix typo in helics_cli_extras/pyproject.toml Co-authored-by: Ryan Mast <[email protected]> * Remove pypi package 'install' * Add import check for helics_cli_extras. Direct to helics[cli] * Remove sqlalchemy, pandas, and requests * Make cd-cli-extras happen only on workflow dispatch (will require manual version updates) --------- Co-authored-by: Joseph McKinsey <[email protected]> Co-authored-by: Ryan Mast <[email protected]>
- Loading branch information
1 parent
c98928a
commit cfe4eb2
Showing
44 changed files
with
486 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: CD - CLI Extras | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
publish_to_pypi: | ||
description: 'Publish to TestPyPI and PyPI' | ||
required: true | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
build-wheels: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
|
||
- name: Set up Python3 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install python3 dependencies | ||
run: | | ||
python -m pip install -U pip wheel setuptools cffi build | ||
- name: Build cli_extras wheel | ||
run: | | ||
cd helics_cli_extras/client | ||
npm install | ||
npm run build | ||
cp -r build ../helics_cli_extras/static | ||
cd .. | ||
python -m build | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-cli-extras-dist | ||
path: helics_cli_extras/dist/* | ||
|
||
publish-helics: | ||
needs: [build-wheels] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi-cli-extras | ||
url: https://pypi.org/p/helics-cli-extras | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- name: Get the built packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
merge-multiple: true | ||
path: helics_cli_extras/dist | ||
|
||
- name: Publish package to TestPyPI | ||
if: ${{ github.event.inputs.publish_to_pypi == true }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_PASSWORD }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
packages-dir: helics_cli_extras/dist | ||
|
||
- name: Publish package to PyPI | ||
if: ${{ github.event.inputs.publish_to_pypi == true }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: helics_cli_extras/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: CI - CLI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.9"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip wheel setuptools cffi | ||
- name: Build NPM | ||
run: | | ||
cd helics_cli_extras/client | ||
npm install | ||
npm run build | ||
cp -r build ../helics_cli_extras/static | ||
- name: Build the web interface first | ||
run: | | ||
cd helics_cli_extras | ||
pip install . | ||
- name: Download helics library and run pip install | ||
run: | | ||
python setup.py download | ||
python setup.py build_ext | ||
pip install -e ".[cli]" | ||
- name: Run Server | ||
run: | | ||
helics server & | ||
sleep 5 | ||
curl http://localhost:5000 | ||
kill %+ | ||
- name: Run Observer | ||
run: | | ||
mkdir db | ||
helics observer & | ||
sleep 5 | ||
kill %+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.