Address issue #33, check compatibility and update CI #49
Workflow file for this run
This file contains hidden or 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: Build msmbuilder2022 source code | |
on: | |
push: | |
branches: | |
- main | |
# ignore changes to docs | |
paths-ignore: | |
- ./docs/* | |
pull_request: | |
branches: | |
- main | |
# ignore changes to docs | |
paths-ignore: | |
- ./docs/* | |
jobs: | |
build-code: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 6 | |
matrix: | |
python-version: ["3.9","3.10","3.11", "3.12"] | |
os: | |
- macOS-latest | |
- ubuntu-latest | |
- windows-latest | |
exclude: | |
- os: macOS-latest | |
python-version: "3.9" | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set pip cache path | |
run: | | |
if [[ "$RUNNER_OS" == "Linux" ]]; then | |
echo "PIP_CACHE=~/.cache/pip" >> $GITHUB_ENV | |
elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
echo "PIP_CACHE=~/Library/Caches/pip" >> $GITHUB_ENV | |
else | |
echo "PIP_CACHE=$LOCALAPPDATA\\pip\\Cache" >> $GITHUB_ENV | |
fi | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ env.PIP_CACHE }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-activate-base: true | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
activate-environment: test | |
- name: Install required packages | |
run: | | |
conda config --add channels conda-forge | |
# conda install -yq conda-build jinja2 conda-verify | |
if [[ "$RUNNER_OS" == "Linux" ]]; then | |
conda install -yq zlib libstdcxx-ng h5py | |
else | |
conda install -yq zlib h5py | |
fi | |
python -m pip install --upgrade pip | |
# conda update conda-build | |
# - name: Conda build | |
# run: | | |
# conda build --quiet devtools/conda-recipe | |
- name: Pip install | |
run: | | |
python -m pip install . | |
- name: Test with pytest | |
run: | | |
# conda install -yq -c ${CONDA_PREFIX}/conda-bld/ msmbuilder2022 | |
# conda install -yq numdifftools hmmlearn | |
pip install numdifftools hmmlearn statsmodels | |
pip install pytest | |
mkdir ../../pkgs | |
cp -r msmbuilder/tests ../../pkgs | |
cd ../../pkgs | |
python tests/data_init.py | |
pytest tests/ -v | |