fix SyntaxWarning: invalid escape sequence
(#274)
#348
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
# run every month on day 14 and 28 at 4:44 UTC | |
schedule: | |
- cron: "44 4 14,28 * *" | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
concurrency: | |
group: "${{ github.ref }}-${{ github.head_ref }}" | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
gromacs-version: ["2023.1"] | |
# Test other GROMACS versions selectively on a recent Python. | |
# On macOS only test one GROMACS version and two Python versions | |
# to keep the testing matrix manageable. | |
include: | |
- os: ubuntu-latest | |
python-version: "3.11" | |
gromacs-version: "4.6.5" | |
- os: ubuntu-latest | |
python-version: "3.11" | |
gromacs-version: "2018.6" | |
- os: ubuntu-latest | |
python-version: "3.11" | |
gromacs-version: "2019.1" | |
- os: ubuntu-latest | |
python-version: "3.11" | |
gromacs-version: "2020.6" | |
- os: ubuntu-latest | |
python-version: "3.11" | |
gromacs-version: "2021.1" | |
- os: ubuntu-latest | |
python-version: "3.11" | |
gromacs-version: "2022.4" | |
# explicitly include a few macOS runners: MUST use 2018.6: | |
# (conda-forge GROMACS >= 2021 is compiled to use rdtscp CPU instruction but these | |
# are not available in the macOS GitHub runner so we need to use a different GROMACS | |
# version. 2018.5 from bioconda works. (2021.5 worked previously but not anymore.) | |
# Locally 2023.1 was successfully tested on Intel macOS 13.5.) | |
- os: macOS-latest | |
python-version: "3.11" | |
gromacs-version: "2018.6" | |
- os: macOS-latest | |
python-version: "3.12" | |
gromacs-version: "2018.6" | |
env: | |
MPLBACKEND: agg | |
steps: | |
- uses: actions/checkout@v3 | |
- name: micromamba package and testing environment installation (Python ${{ matrix.python-version }}, GROMACS ${{ matrix.gromacs-version }}) | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ci/conda-envs/test_env.yaml | |
condarc: | | |
channels: | |
- conda-forge | |
- bioconda | |
channel_priority: flexible | |
cache-downloads: true | |
cache-environment: true | |
create-args: >- | |
python=${{ matrix.python-version }}.*=*_cpython | |
gromacs==${{ matrix.gromacs-version }} | |
- name: Python version information ${{ matrix.python-version }} | |
run: | | |
python -c "import sys; print(sys.version)" | |
- name: micromamba environment information | |
run: | | |
micromamba info | |
micromamba list | |
cat /proc/cpuinfo || (/usr/sbin/system_profiler SPHardwareDataType; /usr/sbin/sysctl -a | grep machdep.cpu) | |
micromamba list | grep gromacs | grep ${{ matrix.gromacs-version }} | |
micromamba list | grep python | grep ${{ matrix.python-version }} | |
- name: Install package (with no dependencies) | |
run: | | |
python -m pip install --no-deps . | |
- name: Run tests | |
run: | | |
pytest -v --disable-pytest-warnings --durations=20 --low-performance --cov=gromacs --cov-report=xml --color=yes ./tests | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} | |
file: ./coverage.xml | |
fail_ci_if_error: false |