| 1 |
name: Tests |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- master |
| 6 |
paths-ignore: |
| 7 |
- 'docs/**' |
| 8 |
- '*.md' |
| 9 |
- '*.rst' |
| 10 |
pull_request: |
| 11 |
paths-ignore: |
| 12 |
- 'docs/**' |
| 13 |
- '*.md' |
| 14 |
- '*.rst' |
| 15 |
jobs: |
| 16 |
tests: |
| 17 |
name: ${{ matrix.name }} |
| 18 |
runs-on: ${{ matrix.os }} |
| 19 |
strategy: |
| 20 |
fail-fast: false |
| 21 |
matrix: |
| 22 |
include: |
| 23 |
- {name: '3.14', python: '3.14', os: ubuntu-latest, tox: py314} |
| 24 |
- {name: '3.13', python: '3.13', os: ubuntu-latest, tox: py313} |
| 25 |
- {name: '3.12', python: '3.12', os: ubuntu-latest, tox: py312} |
| 26 |
- {name: '3.12-MacOS', python: '3.12', os: macos-latest, tox: py312} |
| 27 |
- {name: '3.11', python: '3.11', os: ubuntu-latest, tox: py311} |
| 28 |
- {name: '3.11-min', python: '3.11', os: ubuntu-latest, tox: "py311-min"} |
| 29 |
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310} |
| 30 |
- {name: '3.10-min', python: '3.10', os: ubuntu-latest, tox: "py310-min"} |
| 31 |
- {name: '3.10-MacOS', python: '3.10', os: macos-latest, tox: py310} |
| 32 |
- {name: Linting, python: '3.12', os: ubuntu-latest, tox: lint} |
| 33 |
#- {name: Security, python: '3.12', os: ubuntu-latest, tox: security} |
| 34 |
- {name: Coverage, python: '3.12', os: ubuntu-latest, tox: coverage} |
| 35 |
steps: |
| 36 |
- uses: actions/checkout@v4 |
| 37 |
- uses: actions/setup-python@v5 |
| 38 |
with: |
| 39 |
python-version: ${{ matrix.python }} |
| 40 |
cache: 'pip' |
| 41 |
cache-dependency-path: 'requirements/*.txt' |
| 42 |
- name: Cache tox environments |
| 43 |
uses: actions/cache@v4 |
| 44 |
with: |
| 45 |
path: .tox |
| 46 |
key: tox-${{ matrix.tox }}-${{ matrix.python }}-${{ hashFiles('requirements/*.txt', 'pyproject.toml') }} |
| 47 |
restore-keys: | |
| 48 |
tox-${{ matrix.tox }}-${{ matrix.python }}- |
| 49 |
tox-${{ matrix.tox }}- |
| 50 |
- name: Install dependencies and tools |
| 51 |
run: | |
| 52 |
python -m pip install -U pip setuptools wheel tox |
| 53 |
- name: Install Linux dependencies |
| 54 |
if: runner.os == 'Linux' |
| 55 |
run: | |
| 56 |
sudo apt-get update |
| 57 |
sudo apt-get install -y liblzma-dev python3-dev r-bioc-dnacopy zlib1g-dev |
| 58 |
- name: Install Mac OS dependencies |
| 59 |
if: runner.os == 'macOS' |
| 60 |
run: | |
| 61 |
brew install r |
| 62 |
Rscript --no-environ -e "install.packages('BiocManager', repos='https://cloud.r-project.org'); BiocManager::install('DNAcopy')" |
| 63 |
- name: Run the unit test suite |
| 64 |
run: tox -e ${{ matrix.tox }} |
| 65 |
- name: Upload coverage to Codecov |
| 66 |
if: matrix.tox == 'coverage' |
| 67 |
uses: codecov/codecov-action@v4 |
| 68 |
with: |
| 69 |
file: ./coverage.xml |
| 70 |
flags: unittests |
| 71 |
name: codecov-umbrella |
| 72 |
fail_ci_if_error: false |
| 73 |
|