From 817b11353c4ebc23f8290073efc79d54bc3e1128 Mon Sep 17 00:00:00 2001 From: Asher Merrill Date: Tue, 24 Feb 2026 12:32:35 -0700 Subject: [PATCH 1/8] actions: update actions to checkout@v6, upload-artifact@v6, download-artifact@v7, and python-setup@v6 * and whitespace/formatting changes --- .github/workflows/draft-pdf.yml | 6 ++++-- .github/workflows/pypackage.yml | 25 +++++++++++++++++-------- .github/workflows/pypublish.yml | 10 ++++++++-- .github/workflows/pythonapp.yml | 21 +++++++++++++-------- 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index 00cab48..260a918 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -8,15 +8,17 @@ jobs: name: Paper Draft steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v6 + - name: Build draft PDF uses: openjournals/openjournals-draft-action@master with: journal: joss # This should be the path to the paper within your repo. paper-path: paper/paper.md + - name: Upload - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v6 with: name: paper # This is the output path where Pandoc will write the compiled diff --git a/.github/workflows/pypackage.yml b/.github/workflows/pypackage.yml index 8adb959..ceca1eb 100644 --- a/.github/workflows/pypackage.yml +++ b/.github/workflows/pypackage.yml @@ -1,22 +1,27 @@ name: Build Wheel on: [workflow_call] - + jobs: build-wheel: name: Build Wheel for Testing runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v6 + - name: Setup Python 3.9 - uses: actions/setup-python@v3 + uses: actions/setup-python@v6 with: python-version: 3.9 + cache: 'pip' # optional, adds caching for faster builds + - name: Install pypa/build run: >- python -m pip install build --user + - name: Build a binary wheel and a source tarball run: >- python -m @@ -24,16 +29,20 @@ jobs: --sdist --wheel --outdir dist/ - - name: install check-wheel-contents + + - name: Install check-wheel-contents run: >- python3 -m pip install check-wheel-contents - - name: check wheel + + - name: Check wheel run: >- check-wheel-contents dist/*.whl - - uses: actions/upload-artifact@v3 + + - name: Upload Artifact + uses: actions/upload-artifact@v6 with: - path: ./dist/* - + name: python-dist-packages + path: dist/ diff --git a/.github/workflows/pypublish.yml b/.github/workflows/pypublish.yml index cb74ad2..f469b57 100644 --- a/.github/workflows/pypublish.yml +++ b/.github/workflows/pypublish.yml @@ -7,6 +7,7 @@ on: jobs: build-wheel: uses: ./.github/workflows/pypackage.yml + upload_testpypi: name: Publish build to TestPyPI needs: [build-wheel] @@ -17,14 +18,17 @@ jobs: permissions: id-token: write steps: - - uses: actions/download-artifact@v3 + - name: Download artifacts + uses: actions/download-artifact@v7 with: name: artifact path: dist + - name: Upload to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: dist + upload_pypi: name: Publish build to PyPI needs: [build-wheel, upload_testpypi] @@ -35,10 +39,12 @@ jobs: permissions: id-token: write steps: - - uses: actions/download-artifact@v3 + - name: Download artifacts + uses: actions/download-artifact@v7 with: name: artifact path: dist + - name: Upload to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index bde1cc6..e6c40c4 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -1,10 +1,8 @@ name: Build - on: [push, pull_request] jobs: build: - runs-on: ${{ matrix.os }} strategy: matrix: @@ -12,35 +10,45 @@ jobs: python-version: ["3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v6 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} + cache: 'pip' # optional, adds caching for faster builds + - name: Display Python version run: python -c "import sys; print(sys.version)" + - name: Install dependencies run: | python -m pip install --upgrade pip pip install flake8 pytest pytest-cov pip install -r requirements.txt + - name: Lint with flake8 run: | # 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 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test build run: | pip install --editable ./ + - name: Run tests with pytest continue-on-error: true run: | pytest + - name: Test coverage with pytest continue-on-error: true run: | pytest --cov=UncertainSCI + - name: Upload coverage data to coveralls.io run: | pip install coveralls @@ -49,7 +57,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_FLAG_NAME: ${{ matrix.os }} COVERALLS_PARALLEL: true - + coveralls: name: confirm coveralls upload needs: build @@ -64,6 +72,3 @@ jobs: coveralls --service=github --finish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - From c3c48bef0fa751a5a19b9f34427a971c70db2605 Mon Sep 17 00:00:00 2001 From: Asher Merrill Date: Tue, 24 Feb 2026 16:16:18 -0700 Subject: [PATCH 2/8] actions: rename workflows * rename (draft-pdf.yml, Paper Build) to (build-paper.yml, Build Paper) * rename (pypackage.yml, Build Wheel) to (build.yml, Build) * rename (pythonapp.yml, Build) to (test.yml, Test) * delete (testpackage.yml, Build and Test Package) and move functionality to test.yml/Test * rename (pypublish.yml, Publish Python distribution to PyPI and TestPyPI) to (publish.yml, Publish Package) --- .github/workflows/{draft-pdf.yml => build-paper.yml} | 2 +- .github/workflows/{pypackage.yml => build.yml} | 6 +++--- .github/workflows/{pypublish.yml => publish.yml} | 10 +++++----- .github/workflows/{pythonapp.yml => test.yml} | 7 +++++-- .github/workflows/testpackage.yml | 6 ------ 5 files changed, 14 insertions(+), 17 deletions(-) rename .github/workflows/{draft-pdf.yml => build-paper.yml} (97%) rename .github/workflows/{pypackage.yml => build.yml} (93%) rename .github/workflows/{pypublish.yml => publish.yml} (84%) rename .github/workflows/{pythonapp.yml => test.yml} (95%) delete mode 100644 .github/workflows/testpackage.yml diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/build-paper.yml similarity index 97% rename from .github/workflows/draft-pdf.yml rename to .github/workflows/build-paper.yml index 260a918..caceee6 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/build-paper.yml @@ -1,4 +1,4 @@ -name: Paper Build +name: Build Paper on: [push, pull_request] diff --git a/.github/workflows/pypackage.yml b/.github/workflows/build.yml similarity index 93% rename from .github/workflows/pypackage.yml rename to .github/workflows/build.yml index ceca1eb..b164cf5 100644 --- a/.github/workflows/pypackage.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ -name: Build Wheel +name: Build on: [workflow_call] jobs: - build-wheel: - name: Build Wheel for Testing + build: + name: Build UncertainSCI wheel and tarball runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/pypublish.yml b/.github/workflows/publish.yml similarity index 84% rename from .github/workflows/pypublish.yml rename to .github/workflows/publish.yml index f469b57..351f25e 100644 --- a/.github/workflows/pypublish.yml +++ b/.github/workflows/publish.yml @@ -1,16 +1,16 @@ -name: Publish Python distribution to PyPI and TestPyPI +name: Publish Package on: push: tags: - '*' jobs: - build-wheel: - uses: ./.github/workflows/pypackage.yml + build: + uses: ./.github/workflows/build.yml upload_testpypi: name: Publish build to TestPyPI - needs: [build-wheel] + needs: [build] runs-on: ubuntu-latest environment: name: pypi @@ -31,7 +31,7 @@ jobs: upload_pypi: name: Publish build to PyPI - needs: [build-wheel, upload_testpypi] + needs: [build, upload_testpypi] runs-on: ubuntu-latest environment: name: pypi diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/test.yml similarity index 95% rename from .github/workflows/pythonapp.yml rename to .github/workflows/test.yml index e6c40c4..413e8b6 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,11 @@ -name: Build +name: Test on: [push, pull_request] jobs: build: + uses: ./.github/workflows/build.yml + + test: runs-on: ${{ matrix.os }} strategy: matrix: @@ -60,7 +63,7 @@ jobs: coveralls: name: confirm coveralls upload - needs: build + needs: [build, test] runs-on: ubuntu-latest container: python:3-slim diff --git a/.github/workflows/testpackage.yml b/.github/workflows/testpackage.yml deleted file mode 100644 index 4441fcd..0000000 --- a/.github/workflows/testpackage.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: Build and Test Package -on: [push, pull_request] - -jobs: - buildwheel: - uses: ./.github/workflows/pypackage.yml From 4882f769ceb230c69eb9bb128379760abc7e9dbc Mon Sep 17 00:00:00 2001 From: Asher Merrill Date: Tue, 24 Feb 2026 16:25:08 -0700 Subject: [PATCH 3/8] actions: publish requires test --- .github/workflows/publish.yml | 7 +++++-- .github/workflows/test.yml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 351f25e..1a32813 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,9 +8,12 @@ jobs: build: uses: ./.github/workflows/build.yml + test: + uses: ./.github/workflows/test.yml + upload_testpypi: name: Publish build to TestPyPI - needs: [build] + needs: [build, test] runs-on: ubuntu-latest environment: name: pypi @@ -31,7 +34,7 @@ jobs: upload_pypi: name: Publish build to PyPI - needs: [build, upload_testpypi] + needs: [build, test, upload_testpypi] runs-on: ubuntu-latest environment: name: pypi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 413e8b6..b739051 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,5 @@ name: Test -on: [push, pull_request] +on: [push, pull_request, workflow_call] jobs: build: From 3c4f3d76e2c218a040b8a20cb36ff47aefe44b76 Mon Sep 17 00:00:00 2001 From: Asher Merrill Date: Tue, 24 Feb 2026 16:27:00 -0700 Subject: [PATCH 4/8] actions: upload/download package artifacts correctly --- .github/workflows/build.yml | 4 ++-- .github/workflows/publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b164cf5..a5c92c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,5 +44,5 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v6 with: - name: python-dist-packages - path: dist/ + name: uncertainsci-packages + path: dist diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1a32813..d117a12 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v7 with: - name: artifact + name: uncertainsci-packages path: dist - name: Upload to TestPyPI @@ -45,7 +45,7 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v7 with: - name: artifact + name: uncertainsci-packages path: dist - name: Upload to PyPI From f3d4d0f49a03a0dab5e747df63b335befbf8f77d Mon Sep 17 00:00:00 2001 From: Asher Merrill Date: Tue, 24 Feb 2026 17:38:21 -0700 Subject: [PATCH 5/8] actions: remove redundant test with pytest * pytest runs tests and computes test coverage at the same time * two separate runs of pytest are not necessary --- .github/workflows/test.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b739051..8353f7f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,12 +42,7 @@ jobs: run: | pip install --editable ./ - - name: Run tests with pytest - continue-on-error: true - run: | - pytest - - - name: Test coverage with pytest + - name: Run tests with pytest and compute coverage continue-on-error: true run: | pytest --cov=UncertainSCI From 519c8845055c935e3494e64ad9fcc51d291fe288 Mon Sep 17 00:00:00 2001 From: Asher Merrill Date: Tue, 24 Feb 2026 17:38:54 -0700 Subject: [PATCH 6/8] actions: do not permit linting or test errors * continue-on-error for coveralls reporting --- .github/workflows/test.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8353f7f..5cd2a9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,21 +33,19 @@ jobs: - name: Lint with flake8 run: | - # 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 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + flake8 . --count --max-complexity=10 --max-line-length=127 --statistics - name: Test build run: | pip install --editable ./ - name: Run tests with pytest and compute coverage - continue-on-error: true run: | pytest --cov=UncertainSCI - name: Upload coverage data to coveralls.io + continue-on-error: true run: | pip install coveralls coveralls --service=github @@ -64,6 +62,7 @@ jobs: steps: - name: Finished + continue-on-error: true run: | pip3 install --upgrade pip pip3 install --upgrade coveralls From cf58779e2f29cc818eefc498fdfaade8fc0f5ba6 Mon Sep 17 00:00:00 2001 From: Asher Merrill Date: Wed, 25 Feb 2026 12:29:36 -0700 Subject: [PATCH 7/8] actions: change workflow triggers * run build-paper on workflow dispatch or on pr targetting master * run build on workflow dispatch, workflow call, or on pr targetting master * run test on workflow dispatch, workflow call, or on pr targetting master * remove idiomatic dependence of test on build * i.e., test does not inherently require build, so the dependence is removed * split test and lint * i.e., break linting out into own workflow with same triggers as test and build * run publish on tag push matching "v[0-9]+" * split publish and publish-test * run publish-test on tag push matching "v[0-9]+*test*" or "*test*-v[0-9]+" --- .github/workflows/build-paper.yml | 7 ++++-- .github/workflows/build.yml | 7 +++++- .github/workflows/lint.yml | 32 +++++++++++++++++++++++++ .github/workflows/publish-test.yml | 38 ++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 30 +++++++---------------- .github/workflows/test.yml | 29 ++++++++++------------- 6 files changed, 102 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/publish-test.yml diff --git a/.github/workflows/build-paper.yml b/.github/workflows/build-paper.yml index caceee6..46b6191 100644 --- a/.github/workflows/build-paper.yml +++ b/.github/workflows/build-paper.yml @@ -1,6 +1,9 @@ name: Build Paper - -on: [push, pull_request] +on: + workflow_dispatch: + pull_request: + branches: + - master jobs: paper: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5c92c5..47977ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,10 @@ name: Build -on: [workflow_call] +on: + workflow_dispatch: + workflow_call: + pull_request: + branches: + - master jobs: build: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..e6eb990 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: Lint +on: + workflow_dispatch: + workflow_call: + pull_request: + branches: + - master + +jobs: + lint: + name: Lint UncertainSCI + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup Python 3.9 + uses: actions/setup-python@v6 + with: + python-version: 3.9 + cache: 'pip' # optional, adds caching for faster builds + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + pip install -r requirements.txt + + - name: Lint with flake8 + run: | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --max-complexity=10 --max-line-length=127 --statistics diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml new file mode 100644 index 0000000..ee7ddb1 --- /dev/null +++ b/.github/workflows/publish-test.yml @@ -0,0 +1,38 @@ +name: Publish Package (TestPyPI/dry run) +on: + workflow_dispatch: + push: + tags: + - 'v[0-9]+*test*' + - '*test*-v[0-9]+' + +jobs: + lint: + uses: ./.github/workflows/lint.yml + + build: + uses: ./.github/workflows/build.yml + + test: + uses: ./.github/workflows/test.yml + + upload_testpypi: + name: Publish build to TestPyPI + needs: [lint, build, test] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://test.pypi.org/p/UncertainSCI + permissions: + id-token: write + steps: + - name: Download artifacts + uses: actions/download-artifact@v7 + with: + name: uncertainsci-packages + path: dist + + - name: Upload to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d117a12..d5b1479 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,40 +1,26 @@ name: Publish Package on: + workflow_dispatch: push: tags: - - '*' + - 'v[0-9]+' jobs: + lint: + uses: ./.github/workflows/lint.yml + build: uses: ./.github/workflows/build.yml test: uses: ./.github/workflows/test.yml - upload_testpypi: - name: Publish build to TestPyPI - needs: [build, test] - runs-on: ubuntu-latest - environment: - name: pypi - url: https://test.pypi.org/p/UncertainSCI - permissions: - id-token: write - steps: - - name: Download artifacts - uses: actions/download-artifact@v7 - with: - name: uncertainsci-packages - path: dist - - - name: Upload to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist + publish-test: + uses: ./.github/workflows/publish-test.yml upload_pypi: name: Publish build to PyPI - needs: [build, test, upload_testpypi] + needs: [lint, build, test, publish-test] runs-on: ubuntu-latest environment: name: pypi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5cd2a9a..84ab488 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,12 @@ name: Test -on: [push, pull_request, workflow_call] +on: + workflow_dispatch: + workflow_call: + pull_request: + branches: + - master jobs: - build: - uses: ./.github/workflows/build.yml - test: runs-on: ${{ matrix.os }} strategy: @@ -28,23 +30,18 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest pytest-cov + pip install pytest pytest-cov pip install -r requirements.txt - - name: Lint with flake8 - run: | - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - flake8 . --count --max-complexity=10 --max-line-length=127 --statistics - - - name: Test build + - name: Install UncertainSCI run: | pip install --editable ./ - - name: Run tests with pytest and compute coverage + - name: Run tests and compute coverage run: | pytest --cov=UncertainSCI - - name: Upload coverage data to coveralls.io + - name: Upload coverage to coveralls.io continue-on-error: true run: | pip install coveralls @@ -55,13 +52,13 @@ jobs: COVERALLS_PARALLEL: true coveralls: - name: confirm coveralls upload - needs: [build, test] + name: Confirm coveralls.io reporting + needs: test runs-on: ubuntu-latest container: python:3-slim steps: - - name: Finished + - name: Finish coveralls.io reporting continue-on-error: true run: | pip3 install --upgrade pip From aadabc91410d7c1fe8401847e1778e108987b0cb Mon Sep 17 00:00:00 2001 From: Asher Merrill Date: Thu, 26 Feb 2026 15:57:41 -0700 Subject: [PATCH 8/8] actions: publish and publish-test must be reusable workflows * publish requires publish-test * if publish-test is not a reusable workflow, publish will fail * nice to have symmetry between publish/publish-test triggers --- .github/workflows/publish-test.yml | 1 + .github/workflows/publish.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml index ee7ddb1..dc2d8cb 100644 --- a/.github/workflows/publish-test.yml +++ b/.github/workflows/publish-test.yml @@ -1,6 +1,7 @@ name: Publish Package (TestPyPI/dry run) on: workflow_dispatch: + workflow_call: push: tags: - 'v[0-9]+*test*' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d5b1479..447aeac 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,7 @@ name: Publish Package on: workflow_dispatch: + workflow_call: push: tags: - 'v[0-9]+'