Skip to content

Commit

Permalink
Merge pull request #611 from marrink-lab/deploy
Browse files Browse the repository at this point in the history
Rework the deploy pipeline
  • Loading branch information
pckroon authored Sep 6, 2024
2 parents 359a299 + 8d69df6 commit 5fb0154
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 54 deletions.
70 changes: 33 additions & 37 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,25 @@ env:

jobs:
build:

runs-on: ubuntu-20.04

strategy:
matrix:
py_version: ["3.8", "3.9", "3.10", "3.11"]
py_version: ["3.9", "3.10", "3.11", "3.12"]
include:
- py_version: "3.8"
WITH_CODECOV: true
- py_version: "3.9"
WITH_CODECOV: true
- py_version: "3.10"
WITH_CODECOV: true
- py_version: "3.11"
WITH_CODECOV: true
- py_version: "3.12"
WITH_CODECOV: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
cache: pip
Expand All @@ -54,6 +53,7 @@ jobs:
run: |
coverage run $(which pytest) -vv --hypothesis-show-statistics
coverage report --omit='*/bin/pytest'
coverage xml
- if: ${{ matrix.WITH_CODECOV }}
name: Upload coverage codecov
Expand All @@ -68,11 +68,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -93,11 +93,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -118,37 +118,33 @@ jobs:
deploy:
needs: [build, lint, docs]
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/vermouth
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
pip install pbr
run: |
python3 -m pip install build pbr --user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish package to PyPI
run: python3 -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
63 changes: 49 additions & 14 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,25 @@ env:

jobs:
build:

runs-on: ubuntu-20.04

strategy:
matrix:
py_version: ["3.8", "3.9", "3.10", "3.11"]
py_version: ["3.9", "3.10", "3.11", "3.12"]
include:
- py_version: "3.8"
WITH_CODECOV: true
- py_version: "3.9"
WITH_CODECOV: true
- py_version: "3.10"
WITH_CODECOV: true
- py_version: "3.11"
WITH_CODECOV: true
- py_version: "3.12"
WITH_CODECOV: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
cache: pip
Expand Down Expand Up @@ -71,11 +70,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -96,11 +95,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -116,3 +115,39 @@ jobs:
run: |
mkdir -p doc/source/_static
sphinx-build -EnW -b html doc/source/ doc/build/html
deploy:
needs: [build, lint, docs]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/vermouth
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
- name: Install pypa/build
run: |
python3 -m pip install build pbr --user
- name: Build a binary wheel and a source tarball
run: python3 -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ requires = [
"setuptools >= 30.3.0",
"pbr",
]
build-backend = "pbr.build"

[tool.pytest.ini_options]
addopts = "--import-mode=importlib"
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Chemistry
keywords = martini MD martinize
Expand Down

0 comments on commit 5fb0154

Please sign in to comment.