Skip to content

GH Actions CI

GH Actions CI #161

Workflow file for this run

name: GH Actions CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# Weekly tests at midnight on Sundays run on main by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * 0"
concurrency:
# Specific group naming so CI is only cancelled
# within same PR or on merge to main
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
main-tests:
if: "github.repository == 'MDAnalysis/pathsimanalysis'"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
mdanalysis-version: ["latest", "develop"]
steps:
- uses: actions/checkout@v7
- name: Build information
run: |
uname -a
df -h
ulimit -a
- name: setup_micromamba
uses: mamba-org/setup-micromamba@v3
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: pathsimanalysis-test
create-args: >-
python=${{ matrix.python-version }}
pip
condarc: |
channels:
- conda-forge
- name: Install MDAnalysis version
#uses: MDAnalysis/install-mdanalysis@main
uses: MDAnalysis/install-mdanalysis@44cf01496714f057c094d1e9bad304bf91fc1b17
with:
version: ${{ matrix.mdanalysis-version }}
install-tests: true
installer: micromamba
shell: bash -l {0}
- name: Install package
run: |
python --version
python -m pip install . --no-deps
- name: Python information
run: |
which python
which pip
pip list
micromamba info
micromamba list
- name: Run tests
run: |
pytest -n auto -v --cov=pathsimanalysis --cov-report=xml --color=yes pathsimanalysis/tests/
- name: codecov
if: github.repository == 'MDAnalysis/pathsimanalysis' && github.event_name != 'schedule'
uses: codecov/codecov-action@v7
with:
files: coverage.xml
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: True
pylint_check:
if: "github.repository == 'MDAnalysis/pathsimanalysis'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.11"
- name: Install Pylint
run: |
which pip
which python
pip install pylint mdanalysis
- name: Run Pylint
env:
PYLINTRC: .pylintrc
run: |
pylint pathsimanalysis
pypi_check:
if: "github.repository == 'MDAnalysis/pathsimanalysis'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install pipx twine
- name: Build package
run: |
python -m pipx run build --sdist
- name: Check package build
run: |
DISTRIBUTION=$(ls -t1 dist/pathsimanalysis-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no distribution dist/pathsimanalysis-*.tar.gz found"; exit 1; }
echo "twine check $DISTRIBUTION"
twine check $DISTRIBUTION