Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cmungall committed Mar 6, 2023
1 parent 320aa46 commit ab2b414
Show file tree
Hide file tree
Showing 9 changed files with 394 additions and 11 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Auto-deployment of Documentation
on:
push:
branches: [ main ]
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

- name: Set up Python 3.
uses: actions/setup-python@v3
with:
python-version: 3.9

- name: Install Poetry.
uses: snok/[email protected]

- name: Install dependencies.
run: |
poetry install -E docs
- name: Build documentation.
run: |
echo ${{ secrets.GH_TOKEN }} >> src/semantic_variable_registry/token.txt
mkdir gh-pages
touch gh-pages/.nojekyll
cd docs/
poetry run sphinx-apidoc -o . ../src/semantic_variable_registry/ --ext-autodoc -f
poetry run sphinx-build -b html . _build
cp -r _build/* ../gh-pages/
- name: Deploy documentation.
if: ${{ github.event_name == 'push' }}
uses: JamesIves/[email protected]
with:
branch: gh-pages
force: true
folder: gh-pages
36 changes: 36 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Python Package

on:
workflow_dispatch:
release:
types: [created]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]

- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.9

- name: Install Poetry
run: pip install poetry poetry-dynamic-versioning

- name: Install dependencies
run: poetry install --no-interaction

- name: Build source and wheel archives
run: poetry build

- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}


37 changes: 37 additions & 0 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: semantic-variable-registry QC

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

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10" ]

steps:
- uses: actions/[email protected]

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/[email protected]
- name: Install dependencies
run: poetry install --no-interaction

- name: Check code quality with flake8
run: poetry run tox -e flake8
# - name: Check package metadata with Pyroma
# run: poetry run tox -e pyroma
- name: Check static typing with MyPy
run: poetry run tox -e mypy

- name: Test with pytest and generate coverage file
run: poetry run tox -e py
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ project: python
$(RUN) gen-project $(SCHEMA) -d project

gendocs:
$(RUN) gen-doc -d docs/ --include-top-level-diagram --diagram-type er_diagram $(SCHEMA)
$(RUN) gen-doc --no-mergeimports -d docs/ --include-top-level-diagram --diagram-type er_diagram $(SCHEMA)

python: src/gsvr/datamodel/metamodel.py
src/gsvr/datamodel/metamodel.py:
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ a source representation to generate multiple sub-variables.

## Metamodel

[src/gsvr/schema](src/gsvr/schema)
- [https://linkml.github.io/semantic-variable-registry/Core](https://linkml.github.io/semantic-variable-registry/Core)
- [src/gsvr/schema](src/gsvr/schema)

Note: the schema imports the metamodel, until we have a way to run gen-docs with unmerged schemas then
it is best to look at the Core subset.

## Variables

Expand Down
29 changes: 29 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
site_name: "semantic variable registry"
theme:
name: material
palette:
- media: '(prefers-color-scheme: light)'
scheme: default
primary: teal
accent: amber
toggle:
icon: material/lightbulb
name: Switch to light mode
- media: '(prefers-color-scheme: dark)'
scheme: slate
primary: teal
accent: amber
toggle:
icon: material/lightbulb-outline
name: Switch to dark mode
features:
- content.tabs.link
plugins:
- search
- mermaid2:
version: 9.3.0
nav:
- Home: home.md
- Index: index.md
site_url: https://linkml.github.io/semantic-variable-registry/
repo_url: https://github.com/linkml/semantic-variable-registry/
Loading

0 comments on commit ab2b414

Please sign in to comment.