Merge pull request #24 from andthum/dependabot/github_actions/actions… #52
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
# Test Code. | |
# | |
# See: | |
# https://docs.github.com/en/actions/guides/building-and-testing-python | |
name: "Tests" | |
on: | |
push: | |
branches: | |
- "**" | |
paths: | |
- ".github/**" | |
- "**.py" | |
- "**.rst" | |
- "docs/**" | |
- ".flake8" | |
- "pyproject.toml" | |
- "**requirements*.txt" | |
tags: | |
- "v[0-9]*" | |
release: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
# Tests must be run on all target platforms and Python versions | |
os: | |
- "ubuntu-latest" | |
- "macos-latest" | |
- "windows-latest" | |
python-version: | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
# Do not cancel in-progress jobs if any matrix job fails | |
fail-fast: false | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- name: "Checkout repository" | |
uses: "actions/checkout@v4" | |
- name: "Set up Python ${{ matrix.python-version }}" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: "Add directories where pip installs scripts to PATH" | |
run: | | |
echo "${HOME}/.local/bin" >> ${GITHUB_PATH} | |
# Installation path on MacOS for Python >=3.11. | |
echo "/Users/runner/Library/Python/${{ matrix.python-version }}/bin" >> ${GITHUB_PATH} | |
- name: "Get pip cache dir" | |
# pip's cache path depends on the operating system. See | |
# https://github.com/actions/cache/blob/main/examples.md#python---pip | |
# This requires pip >=20.1. | |
id: "pip-cache" | |
run: | | |
python -m pip install --user --upgrade pip | |
echo "dir=$(pip cache dir)" >> ${GITHUB_OUTPUT} | |
- name: "Create/Restore cache" | |
uses: "actions/cache@v3" | |
with: | |
path: | | |
${{ steps.pip-cache.outputs.dir }}/** | |
./docs/build/** | |
key: | | |
${{ runner.os }}-${{ matrix.python-version }}-${{ github.job }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.python-version }} | |
${{ runner.os }} | |
- name: "Install/Upgrade setuptools and wheel" | |
# MDAnalysis requires NumPy (>=1.19.2) for setup (see also | |
# https://github.com/MDAnalysis/mdanalysis/issues/3374#issuecomment-889189979). | |
# MDAnalysis <3.0 requires Cython <3.0 (see | |
# https://github.com/MDAnalysis/mdanalysis/pull/4129 and | |
# https://github.com/cython/cython/issues/3690). | |
# Without `python-dev-tools` the installation of MDAnalysis | |
# fails on MacOS-latest with Python 3.9 while building the wheel | |
# for MDAnalysis. Strangely, the MDAnalysis wheel is only build | |
# on this OS-Python combination, whereas other OS-Python | |
# combinations fetch a pre-build wheel. | |
run: | | |
python -m pip install --user --upgrade setuptools wheel | |
python -m pip install --user --upgrade python-dev-tools | |
python -m pip install --user "Cython <3.0" | |
python -m pip install --user "numpy >=1.19.2" | |
- name: "Test installation of this project" | |
run: | | |
python -m pip install --user . | |
# The install only installs the required dependencies. This | |
# project contains no python module that can be imported. | |
# python -c "import transfer_Li" |