Skip to content

Commit

Permalink
Merge branch 'develop' into reader_test
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho38 committed Dec 11, 2024
2 parents e43cdfc + 57601ab commit 281d72f
Show file tree
Hide file tree
Showing 71 changed files with 46,275 additions and 1,511 deletions.
3 changes: 3 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ comment:
paths: null
ignore:
- "imdclient/_version.py"
- "imdclient/data"
- "imdclient/tests"
- "examples"
149 changes: 149 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# On PR or push to package-* branch, build wheels and src dists
# On tag with version number, build wheels and src dists and upload to testpypi
# On release, build wheels and src dists and upload to pypi

name: Build and upload to PyPI

on:
pull_request:
branches:
- "main"
push:
tags:
- "v*"
release:
types:
- published

concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true


defaults:
run:
shell: bash -l {0}


jobs:
build_wheels:
name: Build wheels
if: github.repository == 'Becksteinlab/imdclient'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
- name: Build wheel
run: |
pip wheel --no-deps . -w wheelhouse/
- name: Print directory contents
run: |
echo "Contents of the wheelhouse directory:"
ls -l wheelhouse
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifact-whl
path: ./wheelhouse/*.whl

build_sdist:
name: build package source distribution
if: github.repository == 'Becksteinlab/imdclient'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- name: Print directory contents
run: |
echo "Contents of the dist directory:"
ls -l dist
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: ./dist/*.tar.gz

upload_testpypi_imdclient:
name: testpypi_upload_imdclient
if: |
github.repository == 'Becksteinlab/imdclient' &&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
environment:
name: publisher
url: https://test.pypi.org/p/imdclient
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:

- uses: actions/download-artifact@v4
with:
name: artifact-whl
path: dist

- uses: actions/download-artifact@v4
with:
name: artifact-sdist
path: dist

- name: Print directory contents
run: |
echo "Contents of the dist directory:"
ls -l dist
- name: upload_source_and_wheels
uses: pypa/[email protected]
with:
skip-existing: true
repository-url: https://test.pypi.org/legacy/
verbose: true

upload_pypi_imdclient:
name: pypi_upload_imdclient
if: |
github.repository == 'Becksteinlab/imdclient' &&
github.event_name == 'release' && github.event.action == 'published'
environment:
name: publisher
url: https://pypi.org/p/imdclient
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:
- uses: actions/download-artifact@v4
with:
name: artifact-whl
path: dist

- uses: actions/download-artifact@v4
with:
name: artifact-sdist
path: dist

- name: Print directory contents
run: |
echo "Contents of the dist directory:"
ls -l dist
- name: upload_source_and_wheels
uses: pypa/[email protected]
71 changes: 69 additions & 2 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
- develop
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.
Expand All @@ -24,6 +25,7 @@ defaults:

jobs:
environment-config:
if: github.repository == 'Becksteinlab/imdclient'
runs-on: ubuntu-latest
outputs:
stable-python-version: ${{ steps.get-compatible-python.outputs.stable-python }}
Expand All @@ -39,6 +41,7 @@ jobs:
release: "latest"

main-tests:
if: github.repository == 'Becksteinlab/imdclient'
needs: environment-config
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -100,10 +103,13 @@ jobs:
conda info
conda list
- name: Run tests
- name: Run IMDClient tests
run: |
pytest -n auto -v --cov=imdclient --cov-report=xml --color=yes imdclient/tests/test_imdclient.py
- name: Run IMDReader tests
run: |
pytest -n auto -v --cov=imdclient --cov-report=xml --color=yes imdclient/tests/test_imdreader.py
- name: codecov
if: github.event_name != 'schedule'
Expand All @@ -113,7 +119,67 @@ jobs:
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
verbose: True

simulation_engine_tests:
if: github.repository == 'Becksteinlab/imdclient'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build information
run: |
uname -a
df -h
ulimit -a
- name: Install conda dependencies
uses: conda-incubator/setup-miniconda@v2
with:
python-version: "3.11"
environment-file: devtools/conda-envs/test_env.yaml
add-pip-as-python-dependency: true
architecture: x64

channels: conda-forge, defaults

activate-environment: imdclient-test
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true
miniconda-version: latest

- name: Install MDAnalysis version
uses: MDAnalysis/install-mdanalysis@main
with:
version: latest
install-tests: true
installer: conda
shell: bash -l {0}

- name: Install package
run: |
python --version
python -m pip install . --no-deps
- name: Pull container
run: |
docker pull ghcr.io/becksteinlab/streaming-md-docker:main-Common-CPU
- name: Run GROMACS tests
run: |
pytest -v --color=yes imdclient/tests/test_gromacs.py
- name: Run LAMMPS tests
run: |
pytest -v --color=yes imdclient/tests/test_lammps.py
# SUSPEND until NAMD permissions are resolved
# - name: Run NAMD tests
# run: |
# pytest -v --color=yes imdclient/tests/test_namd.py

pylint_check:
if: github.repository == 'Becksteinlab/imdclient'
needs: environment-config
runs-on: ubuntu-latest

Expand All @@ -139,6 +205,7 @@ jobs:
pypi_check:
if: github.repository == 'Becksteinlab/imdclient'
needs: environment-config
runs-on: ubuntu-latest

Expand Down
86 changes: 0 additions & 86 deletions .github/workflows/gromacs-integration.yaml

This file was deleted.

Loading

0 comments on commit 281d72f

Please sign in to comment.