Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split web server into separate package #98

Merged
merged 19 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/cd-cli-extras.yml
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
5 changes: 3 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
tags:
- v*
workflow_dispatch:

jobs:
build-wheels:
Expand Down Expand Up @@ -37,7 +38,7 @@ jobs:

- name: Install python3 dependencies
run: |
python -m pip install -U pip install wheel setuptools cffi
python -m pip install -U pip wheel setuptools cffi

- name: Download helics library
run: python setup.py download --plat-name=${{ matrix.target }}
Expand Down Expand Up @@ -97,7 +98,7 @@ jobs:
with:
user: __token__
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags/')
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/ci-cli-extras.yml
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 %+
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: CI

on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
Expand All @@ -19,7 +25,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip install wheel setuptools cffi
python -m pip install -U pip wheel setuptools cffi
- name: Download helics library and run pip install
run: |
python setup.py download
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install -U pip install wheel setuptools
python -m pip install -U pip wheel setuptools
python setup.py download
pip install -e ".[cli,docs]"
- name: Copy README.md
Expand Down
Loading
Loading