Update pyproject.toml #221
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 | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ contains(matrix.python-version, 'pypy') }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install pipenv | |
pipenv install --python "${{ matrix.python-version }}" --dev --system --skip-lock | |
- name: Write karate_club.tsv | |
run: python3 -c 'import networkx as nx; nx.write_weighted_edgelist(nx.karate_club_graph(), "karate_club.tsv", delimiter="\t")' | |
- name: Lint with Mypy | |
run: mypy chinese_whispers | |
- name: Lint with Ruff | |
uses: chartboost/ruff-action@v1 | |
- name: Test with unittest | |
run: python3 -m unittest discover | |
- name: Run Module | |
run: python3 -m chinese_whispers karate_club.tsv | |
- name: Run CLI | |
run: chinese-whispers karate_club.tsv | |
- name: Run Jupyter | |
run: | | |
mkdir jupyter | |
jupyter nbconvert --to html --output jupyter/index.html --execute example.ipynb | |
- name: Run MkDocs | |
run: mkdocs build --strict | |
- name: Build | |
run: python3 -m build --sdist --wheel . | |
- name: Validate CITATION.cff | |
uses: citation-file-format/[email protected] | |
with: | |
args: "--validate" | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: "./jupyter" | |
if: matrix.python-version == '3.12' && github.ref == 'refs/heads/master' | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |