diff --git a/.github/conda-env/test-env.yml b/.github/conda-env/test-env.yml deleted file mode 100644 index adaf685cf..000000000 --- a/.github/conda-env/test-env.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: test-env -dependencies: - - pip - - coverage - - coveralls - - pytest - - pytest-cov - - pytest-timeout - - numpy - - matplotlib - - scipy diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index ef6033180..580648c03 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -35,36 +35,29 @@ jobs: run: sudo apt-get -y install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils - name: Setup Conda - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: ${{ matrix.python-version }} - activate-environment: test-env - environment-file: .github/conda-env/test-env.yml - miniforge-version: latest - miniforge-variant: Mambaforge - channels: conda-forge - channel-priority: strict - auto-update-conda: false - auto-activate-base: false - - - name: Install optional dependencies - shell: bash -l {0} run: | - if [[ '${{matrix.slycot}}' == 'conda' ]]; then - mamba install slycot - fi - if [[ '${{matrix.pandas}}' == 'conda' ]]; then - mamba install pandas - fi - if [[ '${{matrix.cvxopt}}' == 'conda' ]]; then - mamba install cvxopt - fi - + echo $CONDA/bin >> $GITHUB_PATH + conda create -q -c conda-forge --strict-channel-priority -n test-environment \ + python=${{matrix.python-version}} \ + coverage \ + coveralls \ + pytest \ + pytest-cov \ + pytest-timeout \ + numpy \ + matplotlib \ + scipy \ + ${{ matrix.slycot == 'conda' && 'slycot' || '' }} \ + ${{ matrix.pandas == 'conda' && 'pandas' || '' }} \ + ${{ matrix.cvxopt == 'conda' && 'cvxopt' || '' }} + - name: Test with pytest - shell: bash -l {0} env: PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }} - run: xvfb-run pytest --cov=control --cov-config=.coveragerc control/tests + run: | + source $CONDA/bin/activate test-environment + conda list + xvfb-run pytest --cov=control --cov-config=.coveragerc control/tests - name: Coveralls parallel # https://github.com/coverallsapp/github-action