Skip to content

Commit 973e4f7

Browse files
authored
Align workflows (#75)
1 parent bddb92c commit 973e4f7

13 files changed

+116
-198
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
paths:
8-
- '**.py'
8+
- '**.py'
99

1010
pull_request:
1111
branches:
@@ -19,11 +19,11 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Check out Git repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323
- name: Set up Python
24-
uses: actions/setup-python@v5
24+
uses: actions/setup-python@v6
2525
with:
26-
python-version: '3.13'
26+
python-version: '3.x'
2727
- name: Install Python dependencies
2828
run: |
2929
python -m pip install .[lint]

.github/workflows/mkdocs_build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@ name: Build docs
22

33
on:
44
pull_request:
5-
branches: main
5+
branches:
6+
- main
67

78
# Allows manual run from the Actions tab
89
workflow_dispatch:
910

1011
jobs:
1112
build-docs:
13+
name: Build docs
1214
runs-on: ubuntu-latest
1315
steps:
1416
- name: Checkout repo
15-
uses: actions/checkout@v4
17+
uses: actions/checkout@v6
1618
- name: Setup python
17-
uses: actions/setup-python@v5
19+
uses: actions/setup-python@v6
1820
with:
19-
python-version: "3.x"
21+
python-version: '3.x'
2022
- name: Install packages
2123
run: |
2224
python3 -m pip install --upgrade pip

.github/workflows/mkdocs_deploy.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,21 @@ on:
44
push:
55
branches:
66
- main
7-
paths:
8-
- 'mkdocs.yml'
9-
- 'docs/**'
107

118
# Allows manual run from the Actions tab
129
workflow_dispatch:
1310

1411
jobs:
1512
build-docs:
13+
name: Build docs
1614
runs-on: ubuntu-latest
1715
steps:
1816
- name: Checkout repo
19-
uses: actions/checkout@v4
17+
uses: actions/checkout@v6
2018
- name: Setup python
21-
uses: actions/setup-python@v5
19+
uses: actions/setup-python@v6
2220
with:
23-
python-version: "3.x"
21+
python-version: '3.x'
2422
- name: Install packages
2523
run: |
2624
python3 -m pip install --upgrade pip
@@ -30,11 +28,12 @@ jobs:
3028
mkdocs build -d site
3129
- name: Upload static files as artifact
3230
id: deployment
33-
uses: actions/upload-pages-artifact@v3
31+
uses: actions/upload-pages-artifact@v4
3432
with:
3533
path: site/
3634

3735
deploy-docs:
36+
name: Deploy docs
3837
runs-on: ubuntu-latest
3938
environment:
4039
name: github-pages

.github/workflows/promote_package_to_production.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/publish_pypi.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
# Allows manual run from the Actions tab
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
name: Build distribution
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v6
14+
- name: Set up Python
15+
uses: actions/setup-python@v6
16+
with:
17+
python-version: '3.x'
18+
- name: Build
19+
run: |
20+
python3 -m pip install build --user
21+
python3 -m build
22+
- name: Store packages
23+
uses: actions/upload-artifact@v6
24+
with:
25+
name: python-package-distributions
26+
path: dist/
27+
28+
publish-to-pypi:
29+
name: Publish distribution to PyPI
30+
runs-on: ubuntu-latest
31+
needs:
32+
- build
33+
environment:
34+
name: pypi
35+
url: https://pypi.org/project/emod-api
36+
permissions:
37+
id-token: write # IMPORTANT: mandatory for trusted publishing
38+
steps:
39+
- name: Download distribution files
40+
uses: actions/download-artifact@v7
41+
with:
42+
name: python-package-distributions
43+
path: dist/
44+
- name: Upload files to PyPI
45+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/staging-build-package.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test and update version
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'emod_api/**'
9+
- 'pyproject.toml'
10+
11+
# Allows manual run from the Actions tab
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: write # Allow writing to the repository (e.g., commits, pushes)
16+
17+
jobs:
18+
run-tests:
19+
name: Run tests
20+
uses: ./.github/workflows/tests_all.yml
21+
22+
bump-version:
23+
name: Bump patch version
24+
runs-on: ubuntu-latest
25+
needs:
26+
- run-tests
27+
steps:
28+
- name: Bump version
29+
uses: callowayproject/bump-my-version@v1
30+
with:
31+
args: patch -vv

.github/workflows/test_and_publish_package_to_staging.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
pull_request:
55
branches:
66
- main
7-
- for-emodpy-malaria
87

98
# Allows manual run from the Actions tab
109
workflow_dispatch:
@@ -17,14 +16,15 @@ jobs:
1716
name: Run tests
1817
runs-on: ${{ matrix.os }}
1918
strategy:
19+
max-parallel: 8
2020
matrix:
2121
os: [ubuntu-latest, windows-latest]
22-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
22+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
2323
steps:
2424
- name: Checkout repo
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2626
- name: Setup python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v6
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030
- name: Install optional dependencies
@@ -34,14 +34,14 @@ jobs:
3434
shell: bash
3535
- name: Install dependencies
3636
run: |
37-
python -m pip install --upgrade pip
38-
python -m pip install .[test] --extra-index-url=https://packages.idmod.org/api/pypi/pypi-production/simple
39-
- name: Run unit tests
37+
python3 -m pip install --upgrade pip
38+
python3 -m pip install .[test]
39+
- name: Run tests
4040
run: |
4141
cd tests
42-
python -m pytest --dist loadfile -v --junitxml="test_results.xml"
42+
python3 -m pytest --dist loadfile -v --junitxml="test_results.xml"
4343
- name: Upload emodpy test results
44-
uses: actions/upload-artifact@v4
44+
uses: actions/upload-artifact@v6
4545
if: failure()
4646
with:
4747
name: emodpy_test_results

0 commit comments

Comments
 (0)