Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions .github/workflows/coveralls-main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Coveralls Main

on:
push:
branches: [main]

workflow_dispatch:

permissions:
contents: read

concurrency:
group: coveralls-main-${{ github.ref }}
cancel-in-progress: true

jobs:
python-coverage:
name: Build main coverage baseline (Python)
runs-on: ubuntu-24.04
timeout-minutes: 30

permissions:
contents: read
checks: write
statuses: write

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python 3.14
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: "3.14"

- name: Install testing dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[testing]

- name: Run coverage
run: |
python -m pytest tests/unit \
--cov sist \
--cov-report term-missing \
--cov-report xml \
-q

- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.xml
flag-name: python
parallel: true
fail-on-error: false

cpp-coverage:
name: Build main coverage baseline (C++)
runs-on: ubuntu-24.04
timeout-minutes: 30

permissions:
contents: read
checks: write
statuses: write

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python 3.14
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: "3.14"

- name: Setup Conda (for irf only)
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4
with:
miniforge-variant: Miniforge3
auto-activate: true
activate-environment: base
conda-remove-defaults: true
channels: conda-forge,bioconda
channel-priority: strict

- name: Install irf
shell: bash -l {0}
run: |
conda install -y \
--override-channels \
-c bioconda \
-c conda-forge \
"irf>=3.09,<3.10"

- name: Install sist and coverage tooling
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -e .[testing]
python -m pip install gcovr

- name: Build qsidd with coverage instrumentation
run: |
make -C src/trans_three clean
make -C src/trans_three coverage
make -C src/trans_compete clean
make -C src/trans_compete coverage

- name: Run regression tests against instrumented binaries
shell: bash -l {0}
env:
CONDA_BUILD_STATE: TEST
SIST_TRANS_THREE_BIN: ${{ github.workspace }}/src/trans_three/qsidd
SIST_TRANS_COMPETE_BIN: ${{ github.workspace }}/src/trans_compete/qsidd
run: python -m pytest tests/regression -vv

- name: Generate lcov report
run: |
gcovr --root . \
--filter 'src/trans_three/.*' \
--filter 'src/trans_compete/.*' \
--gcov-ignore-parse-errors=suspicious_hits.warn \
--lcov coverage.info

- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.info
flag-name: cpp
parallel: true
fail-on-error: false

finish:
name: Close Coveralls build
needs: [python-coverage, cpp-coverage]
runs-on: ubuntu-24.04

steps:
- name: Close parallel build
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
38 changes: 38 additions & 0 deletions .github/workflows/daily.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Daily Unit Tests

on:
schedule:
- cron: '0 8 * * 1-5'
workflow_dispatch:

concurrency:
group: daily-${{ github.ref }}
cancel-in-progress: true

jobs:
unit:
name: Unit (py${{ matrix.python-version }})
runs-on: ubuntu-24.04
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}

- name: Install testing dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[testing]

- name: Run unit tests
run: python -m pytest tests/unit
70 changes: 69 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,33 @@ concurrency:
cancel-in-progress: true

jobs:
unit:
name: Unit (py${{ matrix.python-version }})
runs-on: ubuntu-24.04
timeout-minutes: 15

strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.python-version }}

- name: Install testing dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[testing]

- name: Run unit tests
run: python -m pytest tests/unit

regression:
name: Regression
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -78,4 +105,45 @@ jobs:
name: docs-html
path: docs/build/html/
if-no-files-found: error
retention-days: 7
retention-days: 7

coverage:
name: Coverage
needs: unit
runs-on: ubuntu-24.04
timeout-minutes: 30

permissions:
contents: read
checks: write
statuses: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python 3.14
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: "3.14"

- name: Install testing dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[testing]

- name: Run coverage
run: |
python -m pytest tests/unit \
--cov sist \
--cov-report term-missing \
--cov-report xml \
-q

- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.xml
fail-on-error: false
17 changes: 17 additions & 0 deletions .github/workflows/update-copyright-years-in-license-file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Update copyright year(s) in license file

on:
schedule:
- cron: '0 3 1 1 *' # 03:00 AM on January 1
workflow_dispatch:

jobs:
update-license-year:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- uses: FantasticFiasco/action-update-license-year@f180e962fa988db222d8f03ef4636750312d1b3d # v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/weekly-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Weekly Docs Build

on:
schedule:
- cron: '0 8 * * 1'
workflow_dispatch:

concurrency:
group: weekly-docs-${{ github.ref }}
cancel-in-progress: true

jobs:
docs:
name: Docs build (python ${{ matrix.python-version }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]
timeout-minutes: 30

steps:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r docs/requirements.txt

- name: Build docs (warnings as errors)
run: |
make -C docs clean
make -C docs html SPHINXOPTS="-W --keep-going"

- name: Upload docs artifacts on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: docs-py${{ matrix.python-version }}-failure
path: |
docs/build/**
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Regression Tests
name: Weekly Regression Tests

on:
push:
branches:
- main
schedule:
- cron: "0 8 * * 1"
workflow_dispatch:
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ src/trans_compete/depend
# Debug information files
*.dwo

# gcov/lcov coverage instrumentation and reports
*.gcno
*.gcda
coverage.info

# Build directories
build/
dist/
Expand All @@ -75,6 +80,10 @@ __pycache__/
.ruff_cache/
*.egg-info/

# Coverage
.coverage
coverage.xml

# Regression test artefacts
.testdata/
test-results/
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ SIST: Stress-Induced Structural Transitions in superhelical DNA

| Category | Badges |
|----------------|--------|
| **Build** | [![PR Checks](https://github.com/CCPBioSim/SIST/actions/workflows/pr.yaml/badge.svg)](https://github.com/CCPBioSim/SIST/actions/workflows/pr.yaml) |
| **Documentation** | [![Docs - Status](https://app.readthedocs.org/projects/sist/badge/?version=latest)](https://sist.readthedocs.io/en/latest/?badge=latest) |
| **Build** | [![PR Checks](https://github.com/CCPBioSim/SIST/actions/workflows/pr.yaml/badge.svg)](https://github.com/CCPBioSim/SIST/actions/workflows/pr.yaml) [![Daily Tests](https://github.com/CCPBioSim/SIST/actions/workflows/daily.yaml/badge.svg)](https://github.com/CCPBioSim/SIST/actions/workflows/daily.yaml) |
| **Regression** | [![Weekly Regression](https://github.com/CCPBioSim/SIST/actions/workflows/weekly-regression.yaml/badge.svg)](https://github.com/CCPBioSim/SIST/actions/workflows/weekly-regression.yaml) |
| **Documentation** | [![Weekly Docs](https://github.com/CCPBioSim/SIST/actions/workflows/weekly-docs.yaml/badge.svg)](https://github.com/CCPBioSim/SIST/actions/workflows/weekly-docs.yaml) [![Docs - Status](https://app.readthedocs.org/projects/sist/badge/?version=latest)](https://sist.readthedocs.io/en/latest/?badge=latest) |
| **Citation** | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22753478.svg)](https://doi.org/10.5281/zenodo.22753478) |
| **Anaconda** | [![Anaconda.org](https://anaconda.org/CCPBioSim/sist/badges/version.svg)](https://anaconda.org/CCPBioSim/sist/) [![Last Updated](https://anaconda.org/CCPBioSim/sist/badges/latest_release_date.svg)](https://anaconda.org/CCPBioSim/sist) [![Platforms](https://anaconda.org/CCPBioSim/sist/badges/platforms.svg)](https://anaconda.org/CCPBioSim/sist) [![License](https://anaconda.org/CCPBioSim/sist/badges/license.svg)](https://anaconda.org/CCPBioSim/sist) [![Downloads](https://anaconda.org/CCPBioSim/sist/badges/downloads.svg)](https://anaconda.org/CCPBioSim/sist)|
| **Quality** | [![Coverage Status](https://coveralls.io/repos/github/CCPBioSim/SIST/badge.svg?branch=main)](https://coveralls.io/github/CCPBioSim/SIST?branch=main) |
Expand Down
2 changes: 1 addition & 1 deletion conda-recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ command -v irf
command -v python
command -v pytest

python -m pytest tests -vv
python -m pytest tests/regression -vv
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ sist = "sist.cli:main"
[project.optional-dependencies]
testing = [
"pytest>=9.0,<10.0",
"pytest-cov>=7.0,<8.0",
"mypy>=1.14,<2.0",
]

Expand Down
Loading
Loading