Skip to content

An attempt to fixing Twine problem #240

An attempt to fixing Twine problem

An attempt to fixing Twine problem #240

Workflow file for this run

name: Unit Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
actions: read
id-token: write
pages: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
environment: test
permissions:
id-token: write
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@v5
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: Lint Jupyter with Mypy
run: nbqa mypy *.ipynb
- name: Lint Jupyter with Ruff
run: nbqa ruff *.ipynb
- 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 .
twine check --strict dist/*
- name: Validate CITATION.cff
uses: citation-file-format/[email protected]
with:
args: "--validate"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./jupyter"
if: matrix.python-version == '3.12' && github.ref == 'refs/heads/master'
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
if: matrix.python-version == '3.12' && github.ref == 'refs/heads/master'
deploy:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
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@v4