diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90ea2705..6e366c77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,18 +40,27 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Prepare mamba installation + env: + PYTHON_VERSION: ${{ matrix.python-version }} + run: | + # setup correct python version + sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml + + - name: mamba setup + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: environment.yml + cache-downloads: true - name: Install dependencies env: PYTHON_VERSION: ${{ matrix.python-version }} CTAPIPE_VERSION: ${{ matrix.ctapipe-version }} run: | - . $CONDA/etc/profile.d/conda.sh - conda config --set always_yes yes --set changeps1 no - sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml - conda install mamba -n base -c conda-forge + mamba env create -n ci -f environment.yml - conda activate ci + mamba activate ci # we install ctapipe using pip to be able to select any commit, e.g. the current master pip install pytest-cov "git+https://github.com/cta-observatory/ctapipe@$CTAPIPE_VERSION" pip install pyflakes @@ -73,8 +82,7 @@ jobs: run: | # github actions starts a new shell for each "step", so we need to # activate our env again - source $CONDA/etc/profile.d/conda.sh - conda activate ci + mamba activate ci coverage run -m pytest -v coverage xml