pull request 20-05 #17
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: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
python: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, macos-12, macos-14] | |
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 | |
run: | | |
pip install . | |
- name: Test with pytest | |
run: | | |
pip install pytest | |
pytest -v | |
- name: Pyflakes | |
run: | | |
pip install --upgrade pyflakes | |
pyflakes MDRefine | |
- name: Pylint | |
run: | | |
pip install --upgrade pylint | |
pylint -E MDRefine | |
- name: Flake8 | |
run: | | |
pip install --upgrade flake8 | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 MDRefine bin --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | tee flake8_report.txt | |
- name: Upload flake8_report.txt to artifact | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
path: flake8_report.txt | |
name: flake8_report | |
- name: Deploy PyPI | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' && startsWith(github.ref, 'refs/tags/') }} | |
env: | |
MDREFINE_PYPI: ${{ secrets.MDREFINE_PYPI }} | |
run: | | |
pip install twine | |
python setup.py sdist | |
python -m twine upload -u __token__ -p "$MDREFINE_PYPI" dist/MDRefine-*.tar.gz | |