Fix add_pip_as_python_dependency not respected with sharded repodata #3434
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: Tests | |
| on: | |
| # https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#push | |
| push: | |
| branches: | |
| - main | |
| - feature/** | |
| - '[0-9].*.x' # e.g., 4.14.x | |
| - '[0-9][0-9].*.x' # e.g., 23.3.x | |
| # https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request | |
| pull_request: | |
| # https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch | |
| workflow_dispatch: | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| schedule: | |
| - cron: "15 7 * * 1-5" # Mon to Fri, 7:15am | |
| # /CONDA-LIBMAMBA-SOLVER CHANGE | |
| concurrency: | |
| # Concurrency group that uses the workflow name and PR number if available | |
| # or commit SHA as a fallback. If a new build is triggered under that | |
| # concurrency group while a previous build is running it will be canceled. | |
| # Repeated pushes to a PR will cancel all previous builds, while multiple | |
| # merges to main will not cancel. | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| env: | |
| # https://conda.github.io/conda-libmamba-solver/user-guide/configuration/#advanced-options | |
| CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED: true | |
| # Reruns on upstream tests | |
| PYTEST_RERUN_FAILURES: 1 | |
| # Reruns on our tests | |
| PYTEST_RERUN_FAILURES_CLS: 0 | |
| # upstream conda tests that we want to skip | |
| PYTEST_ADDOPTS: "-k \"not test_get_index_lazy and not test_strict_resolve_get_reduced_index and not test_reorder_channel_priority\"" | |
| # for conda-libmamba-solver | |
| PYTEST_CLS_ADDOPTS: "-m \"not slow and not benchmark and not trouble\"" | |
| # See https://github.com/conda/conda/pull/13694 | |
| # we can't break classic from here; no need to test it | |
| # those tests will still be available for local debugging if necessary | |
| CONDA_TEST_SOLVERS: libmamba | |
| CONDA_REF: main # pin conda version to latest for more stable tests | |
| jobs: | |
| # detect whether any code changes are included in this PR | |
| changes: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # necessary to detect changes | |
| # https://github.com/dorny/paths-filter#supported-workflows | |
| pull-requests: read | |
| outputs: | |
| code: ${{ steps.filter.outputs.code }} | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| # dorny/paths-filter needs git clone for non-PR events | |
| # https://github.com/dorny/paths-filter#supported-workflows | |
| if: github.event_name != 'pull_request' | |
| - name: Filter Changes | |
| uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: filter | |
| with: | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| # changed some paths: | |
| filters: | | |
| code: | |
| - 'conda_libmamba_solver/**' | |
| - '*.py' | |
| - '.github/workflows/tests.yml' | |
| - 'tests/**' | |
| - 'dev/requirements.txt' | |
| - 'pyproject.toml' | |
| # /CONDA-LIBMAMBA-SOLVER CHANGE | |
| # windows test suite | |
| windows: | |
| # only run test suite if there are code changes | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # test lower version (w/ defaults) and upper version (w/ defaults and conda-forge) | |
| python-version: ['3.10', '3.13'] | |
| default-channel: [defaults, conda-forge] | |
| test-type: [conda-libmamba-solver, unit, integration] | |
| test-group: [1, 2, 3] | |
| exclude: | |
| - default-channel: conda-forge | |
| python-version: '3.10' | |
| - test-type: unit | |
| test-group: 3 | |
| - test-type: conda-libmamba-solver # CONDA-LIBMAMBA-SOLVER CHANGE | |
| test-group: 2 # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - test-type: conda-libmamba-solver # CONDA-LIBMAMBA-SOLVER CHANGE | |
| test-group: 3 # CONDA-LIBMAMBA-SOLVER CHANGE | |
| env: | |
| ErrorActionPreference: Stop # powershell exit immediately on error | |
| PYTEST_MARKER: ${{ matrix.test-type == 'unit' && 'not integration' || 'integration' }} | |
| PYTEST_SPLITS: ${{ matrix.test-type == 'unit' && '2' || '3' }} | |
| steps: | |
| - name: Checkout conda/conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| repository: conda/conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| path: conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| ref: ${{ env.CONDA_REF }} | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Checkout conda-libmamba-solver | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| path: conda-libmamba-solver | |
| # /CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Hash + Timestamp | |
| shell: bash # use bash to run date command | |
| run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-${{ matrix.default-channel }}-${{ matrix.test-type }}-${{ matrix.test-group }}-$(date -u "+%Y%m")" >> $GITHUB_ENV | |
| - name: Cache Conda | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: cache-${{ env.HASH }} | |
| - name: Setup Miniconda | |
| uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0 | |
| with: | |
| # CONDA-LIBMAMBA-SOLVER CHANGE: add conda\ | |
| condarc-file: conda\.github\condarc-${{ matrix.default-channel }} | |
| run-post: false # skip post cleanup | |
| - name: Upgrade conda-libmamba-solver (without sharded repodata) | |
| shell: bash -el {0} | |
| run: CONDA_PLUGINS_USE_SHARDED_REPODATA=0 conda install --yes -n base conda-canary/label/dev::conda-libmamba-solver | |
| - name: Conda Install | |
| working-directory: conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| # CONDA-LIBMAMBA-SOLVER CHANGE: add conda-libmamba-solver requirements.txt | |
| run: > | |
| conda install | |
| --yes | |
| --file tests\requirements.txt | |
| --file tests\requirements-${{ runner.os }}.txt | |
| --file tests\requirements-ci.txt | |
| --file tests\requirements-s3.txt | |
| --file ..\conda-libmamba-solver\dev\requirements.txt | |
| ${{ matrix.test-type == 'conda-libmamba-solver' && '--file ..\\conda-libmamba-solver\\tests\\requirements.txt' || '' }} | |
| python=${{ matrix.python-version }} | |
| - name: Conda Remove anaconda-auth | |
| run: conda remove --yes -n base anaconda-auth anaconda-anon-usage conda-anaconda-telemetry conda-anaconda-tos | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Install conda-libmamba-solver | |
| run: python -m pip install -e conda-libmamba-solver/ -vv --no-deps --no-build-isolation | |
| #/ CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Conda Info | |
| run: python -m conda info --verbose | |
| - name: Conda Config | |
| run: conda config --show-sources | |
| - name: Conda List Extra | |
| run: | | |
| conda env list | |
| conda list -n base | |
| conda list --show-channel-urls | |
| - name: Setup PowerShell | |
| # for tests/shell, so only necessary for integration tests | |
| if: matrix.test-type == 'integration' | |
| run: | | |
| Invoke-Expression "& { $(Invoke-RestMethod https://aka.ms/install-powershell.ps1) }" | |
| "PWSHPATH=$env:LOCALAPPDATA\Microsoft\powershell" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| - name: PowerShell Info | |
| # for tests/shell, so only necessary for integration tests | |
| if: matrix.test-type == 'integration' | |
| run: | | |
| Get-Command -All powershell | |
| Get-Command -All "$env:PWSHPATH\pwsh.exe" | |
| - name: Run Upstream Tests | |
| working-directory: conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| if: ${{ matrix.test-type != 'conda-libmamba-solver' }} # CONDA-LIBMAMBA-SOLVER CHANGE | |
| run: python -m pytest | |
| --durations-path=durations\${{ runner.os }}.json | |
| --group=${{ matrix.test-group }} | |
| --splits=${{ env.PYTEST_SPLITS }} | |
| --reruns=${{ env.PYTEST_RERUN_FAILURES }} | |
| -m "${{ env.PYTEST_MARKER }}" | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Run conda-libmamba-solver Tests | |
| working-directory: conda-libmamba-solver | |
| if: ${{ matrix.test-type == 'conda-libmamba-solver' }} | |
| shell: bash -el {0} | |
| run: | | |
| python -m pip install -e ../conda/ --no-deps --no-build-isolation | |
| python -m conda init --all | |
| . $CONDA_PREFIX/etc/profile.d/conda.sh | |
| python -m pytest -vv ${{ env.PYTEST_CLS_ADDOPTS }} --reruns=${{ env.PYTEST_RERUN_FAILURES_CLS }} --durations=16 | |
| #/ CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Upload Coverage | |
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | |
| if: false # CONDA-LIBMAMBA-SOLVER CHANGE | |
| with: | |
| flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }} | |
| - name: Upload Test Results | |
| if: '!cancelled()' | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: test-results-${{ env.HASH }} | |
| # CONDA-LIBMAMBA-SOLVER CHANGE: need to prepend conda/ to the paths | |
| path: | | |
| conda\.coverage | |
| conda\durations\${{ runner.os }}.json | |
| conda\test-report.xml | |
| retention-days: 1 # temporary, combined in aggregate below | |
| # linux test suite | |
| linux: | |
| # only run test suite if there are code changes | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: ${{ matrix.runs-on }} | |
| defaults: | |
| run: | |
| # https://github.com/conda-incubator/setup-miniconda#use-a-default-shell | |
| shell: bash -el {0} # bash exit immediately on error + login shell | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # test all lower versions (w/ defaults) and upper version (w/ defaults and conda-forge) | |
| runs-on: [ubuntu-latest, ubuntu-24.04-arm] | |
| python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| default-channel: [defaults, conda-forge] | |
| test-type: [conda-libmamba-solver, unit, integration] | |
| test-group: [1, 2, 3] | |
| exclude: | |
| - python-version: '3.10' | |
| default-channel: conda-forge | |
| - python-version: '3.11' | |
| default-channel: conda-forge | |
| - python-version: '3.12' | |
| default-channel: conda-forge | |
| - test-type: unit | |
| test-group: 3 | |
| - runs-on: ubuntu-24.04-arm | |
| python-version: '3.10' | |
| - runs-on: ubuntu-24.04-arm | |
| python-version: '3.11' | |
| - runs-on: ubuntu-24.04-arm | |
| python-version: '3.12' | |
| - test-type: conda-libmamba-solver # CONDA-LIBMAMBA-SOLVER CHANGE | |
| test-group: 2 # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - test-type: conda-libmamba-solver # CONDA-LIBMAMBA-SOLVER CHANGE | |
| test-group: 3 # CONDA-LIBMAMBA-SOLVER CHANGE | |
| env: | |
| PYTEST_MARKER: ${{ matrix.test-type == 'unit' && 'not integration' || 'integration' }} | |
| PYTEST_SPLITS: ${{ matrix.test-type == 'unit' && '2' || '3' }} | |
| steps: | |
| - name: Checkout conda/conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| repository: conda/conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| path: conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| ref: ${{ env.CONDA_REF }} | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Checkout conda-libmamba-solver | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| path: conda-libmamba-solver | |
| # /CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Hash + Timestamp | |
| run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-${{ matrix.default-channel }}-${{ matrix.test-type }}-${{ matrix.test-group }}-$(date -u "+%Y%m")" >> $GITHUB_ENV | |
| - name: Cache Conda | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: cache-${{ env.HASH }} | |
| - name: Setup Miniconda | |
| uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0 | |
| with: | |
| # CONDA-LIBMAMBA-SOLVER CHANGE: add conda/ | |
| condarc-file: conda/.github/condarc-${{ matrix.default-channel }} | |
| run-post: false # skip post cleanup | |
| - name: Upgrade conda-libmamba-solver (without sharded repodata) | |
| run: CONDA_PLUGINS_USE_SHARDED_REPODATA=0 conda install --yes -n base conda-canary/label/dev::conda-libmamba-solver | |
| - name: Conda Install | |
| working-directory: conda | |
| run: > | |
| conda install | |
| --yes | |
| --file tests/requirements.txt | |
| --file tests/requirements-${{ runner.os }}.txt | |
| --file tests/requirements-ci.txt | |
| --file tests/requirements-s3.txt | |
| --file ../conda-libmamba-solver/dev/requirements.txt | |
| ${{ matrix.test-type == 'conda-libmamba-solver' && '--file ../conda-libmamba-solver/tests/requirements.txt' || '' }} | |
| python=${{ matrix.python-version }} | |
| - name: Conda Remove anaconda-auth | |
| run: conda remove --yes -n base anaconda-auth anaconda-anon-usage conda-anaconda-telemetry conda-anaconda-tos | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Install conda-libmamba-solver | |
| run: python -m pip install -e conda-libmamba-solver/ -vv --no-deps --no-build-isolation | |
| #/ CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Conda Info | |
| run: python -m conda info --verbose | |
| - name: Conda Config | |
| run: conda config --show-sources | |
| - name: Conda List Extra | |
| run: | | |
| conda env list | |
| conda list -n base | |
| conda list --show-channel-urls | |
| - name: Setup Shells | |
| # for tests/shell, so only necessary for integration tests | |
| if: matrix.test-type == 'integration' | |
| run: sudo apt update && sudo apt install ash csh fish tcsh xonsh zsh | |
| - name: Run Tests | |
| working-directory: conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| if: ${{ matrix.test-type != 'conda-libmamba-solver' }} # CONDA-LIBMAMBA-SOLVER CHANGE | |
| run: python -m pytest | |
| --durations-path=durations/${{ runner.os }}.json | |
| --group=${{ matrix.test-group }} | |
| --splits=${{ env.PYTEST_SPLITS }} | |
| --reruns=${{ env.PYTEST_RERUN_FAILURES }} | |
| -m "${{ env.PYTEST_MARKER }}" | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Run conda-libmamba-solver Tests | |
| working-directory: conda-libmamba-solver | |
| if: ${{ matrix.test-type == 'conda-libmamba-solver' }} | |
| run: | | |
| python -m pip install -e ../conda/ --no-deps --no-build-isolation | |
| python -m conda init --all | |
| . $CONDA_PREFIX/etc/profile.d/conda.sh | |
| python -m pytest -vv ${{ env.PYTEST_CLS_ADDOPTS }} --reruns=${{ env.PYTEST_RERUN_FAILURES_CLS }} --durations=16 | |
| #/ CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Upload Coverage | |
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | |
| if: false # CONDA-LIBMAMBA-SOLVER CHANGE | |
| with: | |
| flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }} | |
| - name: Upload Test Results | |
| if: '!cancelled()' | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: test-results-${{ env.HASH }} | |
| path: | | |
| conda/.coverage | |
| conda/durations/${{ runner.os }}.json | |
| conda/test-report.xml | |
| retention-days: 1 # temporary, combined in aggregate below | |
| # linux benchmarks | |
| linux-benchmarks: | |
| needs: changes | |
| if: false # needs.changes.outputs.code == 'true' # disable for now. | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| # https://github.com/conda-incubator/setup-miniconda#use-a-default-shell | |
| shell: bash -el {0} # bash exit immediately on error + login shell | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.12'] | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Hash + Timestamp | |
| run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-benchmark-$(date -u "+%Y%m")" >> $GITHUB_ENV | |
| - name: Cache Conda | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: cache-${{ env.HASH }} | |
| - name: Setup Miniconda | |
| uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0 | |
| - name: Conda Install | |
| run: conda install | |
| --yes | |
| --file tests/requirements.txt | |
| python=${{ matrix.python-version }} | |
| - name: Conda Info | |
| run: python -m conda info --verbose | |
| - name: Conda Config | |
| run: conda config --show-sources | |
| - name: Conda List | |
| run: conda list --show-channel-urls | |
| - name: Run Benchmarks | |
| uses: CodSpeedHQ/action@d872884a306dd4853acf0f584f4b706cf0cc72a2 # v4.13.0 | |
| with: | |
| token: ${{ secrets.CODSPEED_TOKEN }} | |
| run: $CONDA/envs/test/bin/pytest --codspeed | |
| mode: instrumentation | |
| # linux-qemu test suite | |
| linux-qemu: | |
| # only run test suite if there are code changes | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| # needs: changes | |
| if: false | |
| # needs.changes.outputs.code == 'true' | |
| #/ CONDA-LIBMAMBA-SOLVER CHANGE | |
| # Run one single fast test per docker+qemu emulated linux platform to test that | |
| # test execution is possible there (container+tools+dependencies work). Can be | |
| # changed / extended to run specific tests in case there are platform related | |
| # things to test. Running more tests is time consuming due to emulation | |
| # (factor 2-10x slower). | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| # https://github.com/conda-incubator/setup-miniconda#use-a-default-shell | |
| shell: bash -el {0} # bash exit immediately on error + login shell | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.12'] | |
| image: ['continuumio/miniconda3:latest', 'condaforge/miniforge3:latest'] | |
| platform: [arm64, ppc64le, s390x] | |
| exclude: | |
| - image: 'continuumio/miniconda3:latest' | |
| platform: ppc64le | |
| - image: 'condaforge/miniforge3:latest' | |
| platform: s390x | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup QEMU | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 | |
| - name: Run Tests | |
| run: docker run | |
| --rm | |
| --volume ${PWD}:/opt/conda-src | |
| --workdir /opt/conda-src | |
| --platform linux/${{ matrix.platform }} | |
| ${{ matrix.image }} | |
| bash -lc | |
| ". /opt/conda/etc/profile.d/conda.sh | |
| && set -x | |
| && conda create | |
| --name test | |
| --yes | |
| --file tests/requirements.txt | |
| --file tests/requirements-${{ runner.os }}.txt | |
| --file tests/requirements-ci.txt | |
| python=${{ matrix.python-version }} | |
| && conda activate test | |
| && python -m conda info --verbose | |
| && conda config --show-sources | |
| && conda list --show-channel-urls | |
| && python -m pytest tests/test_api.py::test_DepsModifier_contract" | |
| # macos test suite | |
| macos: | |
| # only run test suite if there are code changes | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: ${{ (matrix.arch == 'osx-64' && 'macos-15-intel') || 'macos-latest' }} | |
| defaults: | |
| run: | |
| # https://github.com/conda-incubator/setup-miniconda#use-a-default-shell | |
| shell: bash -el {0} # bash exit immediately on error + login shell | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # test lower version (w/ osx-64 & conda-forge & unit tests) and upper version (w/ osx-arm64 & defaults & integration tests) | |
| arch: [osx-64, osx-arm64] | |
| python-version: ['3.10', '3.13'] | |
| default-channel: [defaults, conda-forge] | |
| test-type: [conda-libmamba-solver, unit, integration] # CONDA-LIBMAMBA-SOLVER CHANGE | |
| test-group: [1, 2, 3] | |
| exclude: | |
| - arch: osx-64 | |
| python-version: '3.13' | |
| - arch: osx-64 | |
| default-channel: defaults | |
| - arch: osx-64 | |
| test-type: integration | |
| - arch: osx-arm64 | |
| python-version: '3.10' | |
| - arch: osx-arm64 | |
| default-channel: conda-forge | |
| - arch: osx-arm64 | |
| test-type: unit | |
| - arch: osx-arm64 # CONDA-LIBMAMBA-SOLVER CHANGE | |
| test-type: conda-libmamba-solver # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - test-type: unit | |
| test-group: 3 | |
| - test-type: conda-libmamba-solver # CONDA-LIBMAMBA-SOLVER CHANGE | |
| test-group: 2 # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - test-type: conda-libmamba-solver # CONDA-LIBMAMBA-SOLVER CHANGE | |
| test-group: 3 # CONDA-LIBMAMBA-SOLVER CHANGE | |
| env: | |
| PYTEST_MARKER: ${{ matrix.test-type == 'unit' && 'not integration' || 'integration' }} | |
| PYTEST_SPLITS: ${{ matrix.test-type == 'unit' && '2' || '3' }} | |
| steps: | |
| - name: Checkout conda/conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| repository: conda/conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| path: conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| ref: ${{ env.CONDA_REF }} | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Checkout conda-libmamba-solver | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| path: conda-libmamba-solver | |
| # /CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Hash + Timestamp | |
| run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-${{ matrix.default-channel }}-${{ matrix.test-type }}-${{ matrix.test-group }}-$(date -u "+%Y%m")" >> $GITHUB_ENV | |
| - name: Cache Conda | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: cache-${{ env.HASH }} | |
| - name: Setup Miniconda | |
| uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0 | |
| with: | |
| # CONDA-LIBMAMBA-SOLVER CHANGE: add conda/ | |
| condarc-file: conda/.github/condarc-${{ matrix.default-channel }} | |
| run-post: false # skip post cleanup | |
| # conda not preinstalled in arm64 runners | |
| miniconda-version: ${{ (matrix.default-channel == 'defaults' && matrix.arch == 'osx-arm64') && 'latest' || null }} | |
| miniforge-version: ${{ (matrix.default-channel == 'conda-forge' && matrix.arch == 'osx-64') && 'latest' || null }} | |
| architecture: ${{ runner.arch }} | |
| - name: Upgrade conda-libmamba-solver (without sharded repodata) | |
| run: CONDA_PLUGINS_USE_SHARDED_REPODATA=0 conda install --yes -n base conda-canary/label/dev::conda-libmamba-solver | |
| - name: Conda Install | |
| working-directory: conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| # CONDA-LIBMAMBA-SOLVER CHANGE: add conda-libmamba-solver requirements.txt | |
| run: > | |
| conda install | |
| --yes | |
| --file tests/requirements.txt | |
| --file tests/requirements-ci.txt | |
| --file tests/requirements-s3.txt | |
| --file ../conda-libmamba-solver/dev/requirements.txt | |
| ${{ matrix.test-type == 'conda-libmamba-solver' && '--file ../conda-libmamba-solver/tests/requirements.txt' || '' }} | |
| python=${{ matrix.python-version }} | |
| - name: Conda Remove anaconda-auth | |
| if: matrix.arch != 'osx-64' | |
| run: conda remove --yes -n base anaconda-auth anaconda-anon-usage conda-anaconda-telemetry conda-anaconda-tos | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Install conda-libmamba-solver | |
| run: python -m pip install -e conda-libmamba-solver/ -vv --no-deps --no-build-isolation | |
| #/ CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Conda Info | |
| run: python -m conda info --verbose | |
| - name: Conda Config | |
| run: conda config --show-sources | |
| - name: Conda List | |
| run: conda list --show-channel-urls | |
| - name: Setup Shells | |
| # for tests/shell, so only necessary for integration tests | |
| if: matrix.test-type == 'integration' | |
| run: brew update && brew install fish xonsh | |
| - name: Run Tests | |
| working-directory: conda # CONDA-LIBMAMBA-SOLVER CHANGE | |
| if: ${{ matrix.test-type != 'conda-libmamba-solver' }} # CONDA-LIBMAMBA-SOLVER CHANGE | |
| run: python -m pytest | |
| --durations-path=durations/${{ runner.os }}.json | |
| --group=${{ matrix.test-group }} | |
| --splits=${{ env.PYTEST_SPLITS }} | |
| --reruns=${{ env.PYTEST_RERUN_FAILURES }} | |
| -m "${{ env.PYTEST_MARKER }}" | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Run conda-libmamba-solver Tests | |
| working-directory: conda-libmamba-solver | |
| if: ${{ matrix.test-type == 'conda-libmamba-solver' }} | |
| run: | | |
| python -m pip install -e ../conda/ --no-deps --no-build-isolation | |
| python -m conda init --all | |
| . $CONDA_PREFIX/etc/profile.d/conda.sh | |
| python -m pytest -vv ${{ env.PYTEST_CLS_ADDOPTS }} --reruns=${{ env.PYTEST_RERUN_FAILURES_CLS }} --durations=16 | |
| #/ CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Upload Coverage | |
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | |
| if: false # CONDA-LIBMAMBA-SOLVER CHANGE | |
| with: | |
| flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }} | |
| - name: Upload Test Results | |
| if: '!cancelled()' | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: test-results-${{ env.HASH }} | |
| # CONDA-LIBMAMBA-SOLVER CHANGE: need to prepend conda/ to the paths | |
| path: | | |
| conda/.coverage | |
| conda/durations/${{ runner.os }}.json | |
| conda/test-report.xml | |
| retention-days: 1 # temporary, combined in aggregate below | |
| # aggregate and upload | |
| aggregate: | |
| # only aggregate test suite if there are code changes | |
| needs: [changes, windows, linux, linux-benchmarks, linux-qemu, macos] | |
| if: >- | |
| !cancelled() | |
| && needs.changes.outputs.code == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| - name: Upload Combined Test Results | |
| # provides one downloadable archive of all matrix run test results for further analysis | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: test-results-${{ github.sha }}-all | |
| path: test-results-* | |
| retention-days: 7 # for durations.yml workflow | |
| - name: Test Summary | |
| uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 | |
| with: | |
| paths: test-results-*/test-report.xml | |
| # required check | |
| analyze: | |
| needs: [windows, linux, linux-qemu, linux-benchmarks, macos, aggregate] | |
| if: '!cancelled()' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Determine Success | |
| uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 | |
| id: alls-green # CONDA-LIBMAMBA-SOLVER CHANGE | |
| with: | |
| # permit jobs to be skipped if there are no code changes (see changes job) | |
| allowed-skips: ${{ toJSON(needs) }} | |
| jobs: ${{ toJSON(needs) }} | |
| # CONDA-LIBMAMBA-SOLVER CHANGE | |
| - name: Checkout our source | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| if: always() && github.event_name == 'schedule' && steps.alls-green.outputs.result == 'failure' | |
| - name: Report failures | |
| if: always() && github.event_name == 'schedule' && steps.alls-green.outputs.result == 'failure' | |
| uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CONDA_LIBMAMBA_SOLVER_ISSUES }} | |
| RUN_ID: ${{ github.run_id }} | |
| TITLE: "Scheduled tests failed" | |
| with: | |
| filename: .github/TEST_FAILURE_REPORT_TEMPLATE.md | |
| update_existing: true | |
| # /CONDA-LIBMAMBA-SOLVER CHANGE | |
| # canary builds | |
| build: | |
| name: Build canary | |
| needs: [analyze] | |
| # only build canary build if | |
| # - prior steps succeeded, | |
| # - this is the main repo, and | |
| # - we are on the main, feature, or release branch | |
| if: >- | |
| !cancelled() | |
| && !github.event.repository.fork | |
| && ( | |
| github.ref_name == 'main' | |
| || startsWith(github.ref_name, 'feature/') | |
| || endsWith(github.ref_name, '.x') | |
| ) | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Clean checkout of specific git ref needed for package metadata version | |
| # which needs env vars GIT_DESCRIBE_TAG and GIT_BUILD_STR: | |
| - name: Checkout Source | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.ref }} | |
| clean: true | |
| fetch-depth: 0 | |
| # Explicitly use Python 3.11 since each of the OSes has a different default Python | |
| - name: Setup Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.11' | |
| - name: Detect Label | |
| shell: python | |
| run: | | |
| from pathlib import Path | |
| from re import match | |
| from os import environ | |
| if "${{ github.ref_name }}" == "main": | |
| # main branch commits are uploaded to the dev label | |
| label = "dev" | |
| elif "${{ github.ref_name }}".startswith("feature/"): | |
| # feature branch commits are uploaded to a custom label | |
| label = "${{ github.ref_name }}" | |
| else: | |
| # release branch commits are added to the rc label | |
| # see https://github.com/conda/infrastructure/issues/760 | |
| _, name = "${{ github.repository }}".split("/") | |
| label = f"rc-{name}-${{ github.ref_name }}" | |
| Path(environ["GITHUB_ENV"]).write_text(f"ANACONDA_ORG_LABEL={label}") | |
| - name: Create & Upload | |
| uses: conda/actions/canary-release@7f6830b1428a9bd47f0b068892c77eae95207037 # v26.1.0 | |
| env: | |
| # Run conda-build in isolated activation to properly package conda | |
| _CONDA_BUILD_ISOLATED_ACTIVATION: 1 | |
| with: | |
| package-name: ${{ github.event.repository.name }} | |
| subdir: noarch | |
| anaconda-org-channel: conda-canary | |
| anaconda-org-label: ${{ env.ANACONDA_ORG_LABEL }} | |
| anaconda-org-token: ${{ secrets.ANACONDA_ORG_CONDA_CANARY_TOKEN }} | |
| conda-build-arguments: --override-channels --channel conda-forge |