Skip to content

micromamba in CI #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 0 additions & 105 deletions .github/workflows/ci-additional.yaml

This file was deleted.

94 changes: 54 additions & 40 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,22 @@ jobs:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV
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/**.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: flox-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

- name: Set up conda environment
shell: bash -l {0}
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: ci/environment.yml
environment-name: flox-tests
cache-env: true
extra-specs: |
python="${{ matrix.python-version }}"
- name: Install flox
run: |
python -m pip install -e .
conda list

- name: Run Tests
shell: bash -l {0}
run: |
pytest -n auto --cov=./ --cov-report=xml

- name: Upload code coverage to Codecov
uses: codecov/[email protected]
with:
Expand All @@ -75,26 +57,57 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false

optional-deps:
name: ${{ matrix.env }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
env:
[
"no-xarray",
"no-dask",
"minimal-requirements",
]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: ci/${{ matrix.env }}.yml
environment-name: flox-tests
cache-env: true
extra-specs: |
python="${{ matrix.python-version }}"
- name: Install flox
run: |
python -m pip install --no-deps -e .
- name: Run tests
run: |
python -m pytest -n auto

upstream-dev:
name: upstream-dev
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
mamba-version: "*"
activate-environment: flox-tests
auto-update-conda: false
python-version: '3.10'
- name: Set up conda environment
shell: bash -l {0}
run: |
mamba env update -f ci/upstream-dev-env.yml
python -m pip install -e .
conda list
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: ci/upstream-dev-env.yml
environment-name: flox-tests
extra-specs: |
python="3.10"
- name: Run Tests
shell: bash -l {0}
run: |
pytest -n 2

Expand All @@ -110,10 +123,11 @@ jobs:
repository: 'pydata/xarray'
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: ci/requirements/environment.yml
environment-name: xarray-tests
cache-env: true
extra-specs: |
python="3.10"
- name: Install xarray
Expand Down