Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-richard committed Aug 1, 2023
1 parent 4115eea commit 6b3eb04
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 30 deletions.
52 changes: 25 additions & 27 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
name: Publish Python distributions to PyPI
name: Upload Python Package

on: [push]
on:
release:
types: [published]

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
deploy:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build .
twine upload dist/*
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tests
name: CI

on: [push]

Expand Down Expand Up @@ -31,12 +31,22 @@ jobs:
pip install -r docs/requirements.txt
pytest
- name: Test with pytest (coverage + long tests)
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
run: |
sudo apt update && sudo apt install -y texlive pandoc
pip install pytest ddt pytest-cov sphinx pandoc
pip install -r docs/requirements.txt
pytest --cov=./ --cov-report=xml
- name: Check that release process is not broken
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
run: |
pip install build wheel twine
python -m build .
twine check dist/*
twine upload --repository testpypi --skip-existing dist/*
- name: Upload coverage reports to Codecov
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
Expand Down

0 comments on commit 6b3eb04

Please sign in to comment.