From 20c955ef49d9670dbc1e6eed652fef2e09f1a8d0 Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 9 Jul 2022 10:10:49 -0600 Subject: [PATCH 1/8] micromamba in CI --- .github/workflows/ci.yaml | 53 +++++++++++++-------------------------- 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b22c249c7..0487c9f69 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: @@ -78,23 +60,24 @@ jobs: 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 + - name: Set up conda environment + uses: mamba-org/provision-with-micromamba@v12 with: - channels: conda-forge - mamba-version: "*" - activate-environment: flox-tests - auto-update-conda: false - python-version: '3.10' + environment-file: ci/upstream-dev-env.yml + environment-name: flox-tests + extra-specs: | + python="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 - name: Run Tests - shell: bash -l {0} run: | pytest -n 2 @@ -110,7 +93,7 @@ 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 From 340170c7c64a49b6f993d6f714568d23b360eb2e Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 9 Jul 2022 10:17:16 -0600 Subject: [PATCH 2/8] small cleanup --- .github/workflows/ci.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0487c9f69..4aa33a281 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,11 +72,6 @@ jobs: environment-name: flox-tests extra-specs: | python="3.10" - - name: Set up conda environment - run: | - mamba env update -f ci/upstream-dev-env.yml - python -m pip install -e . - conda list - name: Run Tests run: | pytest -n 2 From ccd2d09bc9c230ccfe99bcfcb7397e4bc643f0fe Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 9 Jul 2022 10:20:39 -0600 Subject: [PATCH 3/8] cache xarray env --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4aa33a281..6e02ecaec 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -92,6 +92,7 @@ jobs: with: environment-file: ci/requirements/environment.yml environment-name: xarray-tests + cache-env: true extra-specs: | python="3.10" - name: Install xarray From 18c5394823468704fb9e0acecb8ebf9debb52e74 Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 9 Jul 2022 10:29:27 -0600 Subject: [PATCH 4/8] consolidate CI workflows --- .github/workflows/ci-additional.yaml | 105 --------------------------- .github/workflows/ci.yaml | 41 +++++++++++ 2 files changed, 41 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/ci-additional.yaml 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 6e02ecaec..e4142e602 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,6 +57,47 @@ jobs: name: codecov-umbrella fail_ci_if_error: false + optional-deps: + 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: Set up conda environment + 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 --no-deps -e . + - name: Run tests + run: | + python -m pytest -n auto + upstream-dev: name: upstream-dev runs-on: ubuntu-latest From 5956433ff4f884ff0a3c5f310642ad362861f732 Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 9 Jul 2022 10:30:42 -0600 Subject: [PATCH 5/8] fewer steps --- .github/workflows/ci.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e4142e602..a42ad0749 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -79,10 +79,6 @@ jobs: - 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: Set up conda environment uses: mamba-org/provision-with-micromamba@v12 with: From 4f7f935b0c715b547026bf512ec09daf5f65825e Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 9 Jul 2022 10:33:14 -0600 Subject: [PATCH 6/8] fix --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a42ad0749..31dfb44be 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,7 +82,7 @@ jobs: - name: Set up conda environment uses: mamba-org/provision-with-micromamba@v12 with: - environment-file: ci/environment.yml + environment-file: ci/${{ matrix.env }}.yml environment-name: flox-tests cache-env: true extra-specs: | From ae477a41cc0099ddd197748211bc6b2c6b7a15ca Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 9 Jul 2022 10:34:01 -0600 Subject: [PATCH 7/8] remove ci trigger --- .github/workflows/ci.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 31dfb44be..8ea327696 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,8 +60,6 @@ jobs: optional-deps: 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} From 9f8e2beaf0c7df6d8bd487f380253493d15b5cd2 Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 9 Jul 2022 10:35:20 -0600 Subject: [PATCH 8/8] nicer namee --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8ea327696..4db8e6a8a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,7 +58,7 @@ jobs: fail_ci_if_error: false optional-deps: - name: ${{ matrix.os }} ${{ matrix.env }} + name: ${{ matrix.env }} runs-on: ${{ matrix.os }} defaults: run: