Skip to content

Commit

Permalink
[Fix] CI docs runner conda (NeuralEnsemble#615)
Browse files Browse the repository at this point in the history
* fix docs runner

* activate env for steps install, list, and make html

* remove conda update

* add install for pandoc

* change environment file

* optimize macOS runner

* update setup-miniconda t newer version

* edit shell command

* Revert "edit shell command"

This reverts commit 03cd19d.

* add comment

* use mamba in CI runners

* add channels

* add channels

* add proper python version

* update to latest version

* add python version

* change python version

* change mamba version

* activate base

* no auto update

* revert changes

* add update

* change channel

* openmpi install

* don't pin channel

* docs runner update

* add libstd install

* reverse to conda

* update env

* use openmpi

* use conda for mpi4py

* remove comment

* remove env list for  Conda runner

---------

Co-authored-by: Moritz-Alexander-Kern <[email protected]>
  • Loading branch information
Moritz-Alexander-Kern and Moritz-Alexander-Kern authored Mar 25, 2024
1 parent 7112f84 commit d046165
Showing 1 changed file with 33 additions and 30 deletions.
63 changes: 33 additions & 30 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,13 @@ jobs:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{hashFiles('requirements/environment.yml') }}-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}

- uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 # corresponds to v2.2.0
- uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # corresponds to v3.0.3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: elephant
environment-file: requirements/environment-tests.yml
auto-activate-base: false
Expand All @@ -152,17 +155,16 @@ jobs:
shell: bash -l {0}
run: |
python --version
conda env list
conda install mpi4py openmpi
conda install pytest
conda install pytest-cov coveralls
mamba install mpi4py openmpi
mamba install pytest
mamba install pytest-cov coveralls
pip install -e .[extras]
- name: List packages
shell: bash -l {0}
run: |
pip list
conda list
mamba list
python --version
- name: Test with pytest
Expand Down Expand Up @@ -310,7 +312,6 @@ jobs:
matrix:
# OS [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
python-version: [3.9]

# do not cancel all in-progress jobs if any matrix job fails
fail-fast: false
Expand All @@ -325,34 +326,34 @@ jobs:

key: ${{ runner.os }}-pip-${{hashFiles('requirements/environment-tests.yml') }}-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}

- uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 # corresponds to v2.2.0
- uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # corresponds to v3.0.3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
python-version: 3.11
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: elephant
environment-file: requirements/environment-tests.yml
auto-activate-base: false
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Install dependencies
shell: bash -l {0}
shell: bash -el {0}
run: |
python --version
conda env list
conda install mpi4py openmpi
conda install pytest
conda install pytest-cov coveralls
mamba install pytest
mamba install pytest-cov coveralls
pip install -e .
- name: List packages
shell: bash -l {0}
shell: bash -el {0}
run: |
pip list
conda list
mamba list
python --version
- name: Test with pytest
shell: bash -l {0}
shell: bash -el {0}
run: |
pytest --cov=elephant
Expand All @@ -379,11 +380,6 @@ jobs:

- uses: actions/checkout@v3

- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Cache pip
uses: actions/cache@v3
with:
Expand All @@ -392,15 +388,22 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}-${{ hashFiles('**/requirements-tutorials.txt') }}-${{ hashFiles('**/environment-docs.yml') }}
-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}

- uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # corresponds to v3.0.3
with:
auto-update-conda: true
python-version: 3.11
mamba-version: "*"
activate-environment: elephant
environment-file: requirements/environment.yml

- name: Install dependencies
shell: bash -el {0} # enables conda incubator to activate environment
run: |
conda config --add channels conda-forge # bugfix with scipy==1.8.1: libstdcxx-ng 12.1.0 required
sudo apt-get update
sudo apt install -y libopenmpi-dev openmpi-bin
conda update conda
conda install -c conda-forge openmpi pandoc libstdcxx-ng # fix libstdc++.so.6: version for new scipy versions > 1.9.1
conda env update --file requirements/environment-docs.yml --name base
activate base
mamba env update --file requirements/environment-docs.yml --name elephant
python -m pip install --upgrade pip
pip install -r requirements/requirements-docs.txt
pip install -r requirements/requirements-tutorials.txt
Expand All @@ -409,15 +412,15 @@ jobs:
sed -i -E "s/nbsphinx_execute *=.*/nbsphinx_execute = 'always'/g" doc/conf.py
- name: List packages
shell: bash -el {0}
run: |
activate base
pip list
conda list
mamba list
python --version
- name: make html
shell: bash -el {0}
run: |
activate base
cd doc
make html
Expand Down

0 comments on commit d046165

Please sign in to comment.