Skip to content

Commit

Permalink
chore: add documentation build to continuous integration process
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienArcellier committed Mar 4, 2024
1 parent 26eb89a commit 9b7c91a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
sudo pip install poetry
poetry install --with build
- name: install npm environment
- name: install npm environment for ui
run: |
cd ui
npm install
- name: run continuous integration pipeline
run: |
poetry run alfred ci
poetry run alfred ci --back
5 changes: 3 additions & 2 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ jobs:
pip install poetry
poetry install --with build
- name: install npm environment
- name: install npm environment for ui
run: |
cd ui
npm install
- name: run continuous integration pipeline
run: |
poetry run alfred ci
poetry run alfred ci --back
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ jobs:
sudo pip install poetry
poetry install --with build
- name: install npm environment
- name: install npm environment for ui
run: |
cd ui
npm install
- name: install npm environment for docs
run: |
cd docs
npm install
- name: run continuous integration pipeline
run: |
poetry run alfred ci
16 changes: 11 additions & 5 deletions alfred/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
@alfred.command("ci", help="continuous integration pipeline")
@alfred.option('--front', '-f', help="run for frontend only", is_flag=True, default=False)
@alfred.option('--back', '-b', help="run for backend only", is_flag=True, default=False)
def ci(front, back):
if back or (not front and not back):
@alfred.option('--docs', '-d', help="run for documentation only", is_flag=True, default=False)
def ci(front, back, docs):
run_all = (not front and not back and not docs)
if back or run_all:
alfred.invoke_command("ci.mypy")
alfred.invoke_command("ci.pytest")
if front or (not front and not back):
alfred.invoke_command("npm.lint")
alfred.invoke_command("npm.build")

if front or run_all:
alfred.invoke_command("npm.ui.lint")
alfred.invoke_command("npm.ui.build")

if docs or run_all:
alfred.invoke_command("npm.docs.build")

@alfred.command("ci.mypy", help="typing checking with mypy on ./src/streamsync")
def ci_mypy():
Expand Down
18 changes: 12 additions & 6 deletions alfred/npm.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import alfred
import os

@alfred.command("npm.lint", help="lint check ui code")
def npm_lint():

@alfred.command("npm.docs.build", help="build streamsync website and documentation")
def npm_docs_build():
os.chdir("docs")
alfred.run("npm run docs:build")

@alfred.command("npm.ui.lint", help="lint check ui code")
def npm_ui_lint():
os.chdir("ui")
alfred.run("npm run lint:ci")

@alfred.command("npm.build", help="build ui code")
def npm_build():
@alfred.command("npm.ui.build", help="build ui code")
def npm_ui_build():
os.chdir("ui")
alfred.run("npm run build")

@alfred.command("npm.build_custom_components", help="build custom components")
def ui_build_custom():
@alfred.command("npm.ui.build_custom_components", help="build custom components")
def npm_ui_build_custom():
os.chdir("ui")
alfred.run("npm run custom.build")

0 comments on commit 9b7c91a

Please sign in to comment.