mamba-org / setup-micromamba

GitHub Action to set up micromamba
MIT License
105 stars 16 forks source link

Activation of environment seems not to work in bash #209

Closed aseyboldt closed 6 months ago

aseyboldt commented 6 months ago

I have a workflow file that creates an environment, and sets up init-shell, but it seems that for some reason the environment variables are not set correctly in the next step:

    - name: Install micromamba
      uses: mamba-org/setup-micromamba@v1
      with:
        environment-name: sunode-dev
        create-args: >-
          python=${{ matrix.python-version }}
          pytest
          pytest-cov
          hypothesis
          statsmodels
          pytensor
          c-compiler
          sundials<6.0
          numba
          sympy
          typing_extensions
          cffi
          xarray
        init-shell: bash powershell
    - name: Get some debugging info
      run: |
        env
        which gcc

The output of the "get some debugging info" step shows CONDA_PREFIX entry for instance: https://github.com/pymc-devs/sunode/actions/runs/8823438279/job/24223870556?pr=50#step:4:115

It does seem to work on windows however: https://github.com/pymc-devs/sunode/actions/runs/8823438279/job/24223871147?pr=50#step:4:37

The full workflow file: https://github.com/pymc-devs/sunode/blob/1d01448ab6181bf788c525e0139e32c4bc78870d/.github/workflows/main.yml

pavelzw commented 6 months ago

You need to use a login shell. Please take a look at https://github.com/mamba-org/setup-micromamba?tab=readme-ov-file#about-login-shells