pathboy #74
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
name: Mrsal Workflow | |
on: | |
push: | |
branches: | |
- main | |
- 'release/**' | |
- '!releases/**-alpha' | |
release: | |
types: [published] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Set up poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: '1.8.0' | |
- name: Conifgure Poetry | |
run: | | |
poetry config repositories.neomedsys https://pypi.neomodels.app | |
poetry config http-basic.neomedsys ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_PASSWORD }} | |
- name: Install depz | |
run: | | |
poetry install --no-cache --no-root | |
export msg="s/(-)?v[0-9]+\.[0-9]+\.[0-9]+/\1$(poetry version -s)/g" | |
sed -i -E $msg ./README.md | |
sed -i -E 's/(-b)//g' ./README.md | |
sed -i -E 's/(-a)//g' ./README.md | |
- name: Run tests | |
run: | | |
rm -rf ./reports/flake8/*.txt | |
poetry run nox | |
- name: Commit to GH | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
build: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Set up poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: '1.8.0' | |
- name: Conifgure Poetry | |
run: | | |
poetry config repositories.neomedsys https://pypi.neomodels.app | |
poetry config http-basic.neomedsys ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_PASSWORD }} | |
- name: Install dependencies | |
run: | | |
poetry install --no-cache --no-root | |
- name: Build and publish | |
run: | | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
poetry publish --build | |
doc_building: | |
if: github.event_name == 'push' | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.11] | |
poetry-version: [1.8.2] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Conifgure Poetry | |
run: | | |
poetry config repositories.neomedsys https://pypi.neomodels.app | |
poetry config http-basic.neomedsys ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_PASSWORD }} | |
- name: Install Dependencies | |
run: | | |
poetry lock --no-update | |
poetry install --with dev --no-cache --no-root | |
- name: Generate Sphinx Project | |
run: | | |
mkdir -p docs | |
poetry run sphinx-quickstart -q -p "MrsalAMQP" -a "Jon E Nesvold | Raafat Zahran | Martin S Rovang" -v "1.0.0" docs | |
echo "extensions.extend(['sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'myst_parser'])" >> docs/conf.py | |
- name: Generate API Documentation | |
run: | | |
poetry run sphinx-apidoc -o ./docs ./mrsal | |
- name: Build HTML Documentation | |
run: | | |
poetry run sphinx-build -b html ./docs ./docs/_build/html | |
- name: Publish Docs to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/_build/html | |
publish_branch: gh-pages |