diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index ff3e8ab7e63..5636f5d99c3 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -39,22 +39,29 @@ jobs: run: shell: bash -l {0} + env: + CONDA_ENV_FILE: ci/requirements/environment.yml + PYTHON_VERSION: "3.10" + steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for all branches and tags. - - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - channel-priority: strict - mamba-version: "*" - activate-environment: xarray-tests - auto-update-conda: false - python-version: "3.9" - - name: Install conda dependencies + - name: set environment variables run: | - mamba env update -f ci/requirements/environment.yml + echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + - name: Setup micromamba + uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41 + with: + environment-file: ${{env.CONDA_ENV_FILE}} + environment-name: xarray-tests + extra-specs: | + python=${{env.PYTHON_VERSION}} + cache-env: true + cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" + - name: Install xarray run: | python -m pip install --no-deps -e . @@ -76,23 +83,27 @@ jobs: defaults: run: shell: bash -l {0} + env: + CONDA_ENV_FILE: ci/requirements/environment.yml + PYTHON_VERSION: "3.10" steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for all branches and tags. - - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - channel-priority: strict - mamba-version: "*" - activate-environment: xarray-tests - auto-update-conda: false - python-version: "3.9" - - name: Install conda dependencies + - name: set environment variables run: | - mamba env update -f ci/requirements/environment.yml + echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - name: Setup micromamba + uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41 + with: + environment-file: ${{env.CONDA_ENV_FILE}} + environment-name: xarray-tests + extra-specs: | + python=${{env.PYTHON_VERSION}} + cache-env: true + cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" - name: Install xarray run: | python -m pip install --no-deps -e . @@ -118,20 +129,28 @@ jobs: run: shell: bash -l {0} + strategy: + matrix: + environment-file: ["bare-minimum", "min-all-deps"] + fail-fast: false + steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for all branches and tags. - - uses: conda-incubator/setup-miniconda@v2 + + - name: Setup micromamba + uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41 with: + environment-name: xarray-tests + environment-file: false + extra-specs: | + python=3.10 + pyyaml + conda + python-dateutil channels: conda-forge - channel-priority: strict - mamba-version: "*" - auto-update-conda: false - python-version: "3.9" - name: minimum versions policy run: | - mamba install -y pyyaml conda python-dateutil - python ci/min_deps_check.py ci/requirements/bare-minimum.yml - python ci/min_deps_check.py ci/requirements/min-all-deps.yml + python ci/min_deps_check.py ci/requirements/${{ matrix.environment-file }}.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 20f876b52fc..1d5c8ddefba 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -65,6 +65,8 @@ jobs: fetch-depth: 0 # Fetch all history for all branches and tags. - name: Set environment variables run: | + echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + if [[ ${{ matrix.os }} == windows* ]] ; then echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV @@ -83,25 +85,13 @@ jobs: echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV - - name: Cache conda - uses: actions/cache@v3 - with: - path: ~/conda_pkgs_dir - key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ hashFiles('ci/requirements/**.yml') }}-${{ matrix.env }} - - - uses: conda-incubator/setup-miniconda@v2 + - name: Setup micromamba + uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41 with: - channels: conda-forge - channel-priority: strict - mamba-version: "*" - activate-environment: xarray-tests - auto-update-conda: false - python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true - - - name: Install conda dependencies - run: | - mamba env update -f $CONDA_ENV_FILE + environment-file: ${{ env.CONDA_ENV_FILE }} + environment-name: xarray-tests + cache-env: true + cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" # We only want to install this on one run, because otherwise we'll have # duplicate annotations. diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 81d1c7db4b8..b37ec390a71 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -55,17 +55,15 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for all branches and tags. - - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - channel-priority: strict - mamba-version: "*" - activate-environment: xarray-tests - auto-update-conda: false - python-version: ${{ matrix.python-version }} - name: Set up conda environment + uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41 + with: + environment-file: ci/requirements/environment.yml + environment-name: xarray-tests + extra-specs: | + python=${{ matrix.python-version }} + - name: Install upstream versions run: | - mamba env update -f ci/requirements/environment.yml bash ci/install-upstream-wheels.sh - name: Install xarray run: | diff --git a/ci/requirements/bare-minimum.yml b/ci/requirements/bare-minimum.yml index 5986ec7186b..cb5bfa05006 100644 --- a/ci/requirements/bare-minimum.yml +++ b/ci/requirements/bare-minimum.yml @@ -10,6 +10,6 @@ dependencies: - pytest-cov - pytest-env - pytest-xdist - - numpy=1.18 + - numpy=1.19 - packaging=20.0 - - pandas=1.1 + - pandas=1.2