Docs/update docs #84
Workflow file for this run
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: Unit Tests | |
# only run on pushes to main or pull requests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
Continuous-Integration: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: ["3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: snok/install-poetry@v1 | |
- name: Install package | |
run: poetry install | |
- name: Test with pytest | |
run: poetry run pytest | |
- name: Use Codecov to track coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
file: ./coverage.xml | |
- name: Build documentation | |
run: poetry run make html --directory docs/ | |
Continuous-Development: | |
needs: Continuous-Integration | |
if: github.ref == 'refs/heads/main' # github.event_name == 'push' && | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
- name: Install poetry | |
uses: snok/install-poetry@v1 | |
- name: Install package | |
run: poetry install | |
- name: Build package | |
run: poetry build | |
- name: Use Python Semantic Release to prepare release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
poetry run semantic-release publish | |
- name: Publish to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Test install from TestPyPI | |
run: | | |
pip install \ | |
--index-url https://test.pypi.org/simple/ \ | |
--extra-index-url https://pypi.org/simple \ | |
nbiatoolkit | |
# - name: Publish to PyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.PYPI_API_TOKEN }} | |
# - name: Publish package | |
# uses: pypa/gh-action-pypi-publish@27a0a2a | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.PYPI_TOKEN }} | |
# repository_url: https://upload.pypi.org/legacy/ | |
# build_dir: ./dist | |
# - name: Publish documentation | |
# uses: maxheld83/[email protected] | |
# with: | |
# build_dir: docs/_build/html | |
# target_branch: gh-pages | |
# committer_name: "GitHub Actions" | |
# committer_email: "[email protected]" |