diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml deleted file mode 100644 index a4dc9024b..000000000 --- a/.github/workflows/ci-additional.yaml +++ /dev/null @@ -1,105 +0,0 @@ -name: CI Additional -on: - push: - branches: - - "main" - pull_request: - branches: - - "*" - schedule: - - cron: "0 0 * * *" # Daily “At 00:00” - workflow_dispatch: # allows you to trigger manually - -jobs: - detect-ci-trigger: - name: detect ci trigger - runs-on: ubuntu-latest - if: | - github.repository == 'dcherian/flox' - && (github.event_name == 'push' || github.event_name == 'pull_request') - outputs: - triggered: ${{ steps.detect-trigger.outputs.trigger-found }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - uses: xarray-contrib/ci-trigger@v1.1 - id: detect-trigger - with: - keyword: "[skip-ci]" - - test: - name: ${{ matrix.os }} ${{ matrix.env }} - runs-on: ${{ matrix.os }} - needs: detect-ci-trigger - if: needs.detect-ci-trigger.outputs.triggered == 'false' - 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 environment variables - run: | - echo "CONDA_ENV_FILE=ci/${{ matrix.env }}.yml" >> $GITHUB_ENV - - - name: Cache conda - uses: actions/cache@v3 - with: - path: ~/conda_pkgs_dir - key: - ${{ runner.os }}-conda-${{ matrix.env }}-${{ - 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: 3.9 - use-only-tar-bz2: true - - - name: Install conda dependencies - run: | - mamba env update -f $CONDA_ENV_FILE - - - name: Install flox - run: | - python -m pip install --no-deps -e . - - - name: Version info - run: | - conda info -a - conda list - - name: Import flox - run: | - python -c "import flox" - - name: Run tests - run: | - python -m pytest \ - -n auto \ - --cov=flox \ - --cov-report=xml - - - name: Upload code coverage to Codecov - uses: codecov/codecov-action@v3.1.0 - with: - file: ./coverage.xml - flags: unittests,${{ matrix.env }} - env_vars: RUNNER_OS - name: codecov-umbrella - fail_ci_if_error: false diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b22c249c7..4db8e6a8a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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/codecov-action@v3.1.0 with: @@ -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 @@ -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