Example 10: Miniforge, etc #1918
This file contains 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: "Example 10: Miniforge, etc" | |
on: | |
pull_request: | |
branches: | |
- "*" | |
push: | |
branches: | |
- "develop" | |
- "main" | |
- "master" | |
schedule: | |
# Note that cronjobs run on master/main by default | |
- cron: "0 0 * * *" | |
concurrency: | |
group: | |
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
example-10-miniforge: | |
# prevent cronjobs from running on forks | |
if: | |
(github.event_name == 'schedule' && github.repository == | |
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') | |
name: Ex10 (${{ matrix.os }}, Miniforge) | |
runs-on: ${{ matrix.os }}-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu", "macos", "windows"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: setup-miniconda | |
with: | |
environment-file: etc/example-environment.yml | |
miniforge-version: latest | |
- run: | | |
conda info | |
conda list | |
python -VV | |
printenv | sort | |
example-10-miniforge-installation-dir: | |
# prevent cronjobs from running on forks | |
if: | |
(github.event_name == 'schedule' && github.repository == | |
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') | |
name: Ex10 (${{ matrix.os }}, Miniforge) | |
runs-on: ${{ matrix.os }}-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu", "macos", "windows"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: setup-miniconda | |
with: | |
environment-file: etc/example-environment.yml | |
miniforge-version: latest | |
installation-dir: ${{ github.workspace }}/miniforge-latest | |
- run: | | |
conda info | |
conda list | |
python -VV | |
printenv | sort | |
example-10-mambaforge: | |
# NOTE: Mambaforge is now equivalent to Miniforge. | |
# We are only testing this to make sure there's a smooth transition. | |
# It should be removed once the product is definitely sunset. | |
# prevent cronjobs from running on forks | |
if: | |
(github.event_name == 'schedule' && github.repository == | |
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') | |
name: Ex10 (${{ matrix.os }}, Mambaforge) | |
runs-on: ${{ matrix.os }}-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu", "macos", "windows"] | |
include: | |
# should use mamba 0.7.4 to upgrade to mamba 0.7.6 | |
- os: ubuntu | |
environment-file: etc/example-environment-no-name.yml | |
miniforge-variant: Mambaforge | |
miniforge-version: 4.9.2-2 | |
mamba-version: 0.7.6 | |
python-version: 3.6 | |
# should use mamba >= 0.20 | |
- os: ubuntu | |
environment-file: etc/example-environment-no-name.yml | |
miniforge-variant: Mambaforge | |
mamba-version: ">=0.20" | |
# should use mamabforge `latest` | |
- os: windows | |
environment-file: etc/example-explicit.Windows.conda.lock | |
condarc-file: etc/example-condarc.yml | |
miniforge-variant: Mambaforge | |
- os: macos | |
miniforge-variant: Mambaforge | |
miniforge-version: "23.3.1-1" | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: setup-miniconda | |
with: | |
condarc-file: ${{ matrix.condarc-file }} | |
environment-file: ${{ matrix.environment-file }} | |
miniforge-variant: ${{ matrix.miniforge-variant }} | |
miniforge-version: ${{ matrix.miniforge-version }} | |
mamba-version: ${{ matrix.mamba-version }} | |
use-mamba: true | |
python-version: ${{ matrix.python-version }} | |
clean-patched-environment-file: false | |
- run: | | |
mamba info | |
mamba list | |
python -VV | |
printenv | sort | |
- name: verify unpatched environment.yml is reported and not cleaned | |
if: contains(matrix.environment-file, '.yml') && !matrix.python-version | |
run: | | |
set -eux | |
ls '${{ steps.setup-miniconda.outputs.environment-file }}' | |
ls '${{ matrix.environment-file }}' | |
diff -s '${{ steps.setup-miniconda.outputs.environment-file }}' '${{ matrix.environment-file }}' | grep 'are identical' | |
- name: verify patched output is reported, correct, and not cleaned | |
if: contains(matrix.environment-file, '.yml') && matrix.python-version | |
run: | | |
set -eux | |
if [ "$(diff '${{ steps.setup-miniconda.outputs.environment-file }}' '${{ matrix.environment-file }}' | grep -c 'python=${{ matrix.python-version }}')" -ge 1 ] ; then echo ok ; else exit 1 ; fi | |
python --version | grep "Python ${{ matrix.python-version }}" | |
awk '/- conda-forge/,/- defaults/' '${{ steps.setup-miniconda.outputs.environment-file }}' |