Skip to content

Commit

Permalink
General CI refresh (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky authored Jan 23, 2024
1 parent ec76001 commit fc0138c
Show file tree
Hide file tree
Showing 23 changed files with 194 additions and 189 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,46 @@ name: Documentation

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: ['*']

defaults:
run:
shell: bash -l {0}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
condarc-file: ci/condarc
use-mamba: true
python-version: 3.8
environment-file: ci/requirements-docs.yml
activate-environment: xarray-extras-docs

- name: Show conda options
shell: bash -l {0}
run: conda config --show

- name: conda info
shell: bash -l {0}
run: conda info

- name: conda list
shell: bash -l {0}
run: conda list

- name: Install
shell: bash -l {0}
run: python -m pip install --no-deps -e .

- name: Build docs
shell: bash -l {0}
run: sphinx-build -W -j auto -b html -d build/doctrees doc build/html
run: sphinx-build -n -j auto -b html -d build/doctrees doc build/html

- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: xarray_extras-docs
path: build/html
8 changes: 4 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Linting

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: ['*']

Expand All @@ -11,6 +11,6 @@ jobs:
name: pre-commit hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.0
66 changes: 0 additions & 66 deletions .github/workflows/pytest-minimal.yml

This file was deleted.

57 changes: 38 additions & 19 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,87 @@ name: Test latest

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: ['*']

defaults:
run:
shell: bash -l {0}

jobs:
build:
name: ${{ matrix.python-version }} ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.requirements }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: ['3.8', '3.9', '3.10']
os: [ubuntu]
python-version: ['3.8', '3.9', '3.10', '3.11']
requirements: [latest]
include:
# Test on macos and windows (first and last version of python only)
- os: macos
python-version: '3.8'
requirements: latest
- os: macos
python-version: '3.12'
requirements: latest
- os: windows
python-version: '3.8'
requirements: latest
- os: windows
python-version: '3.12'
requirements: latest
# Test on minimal requirements
- os: ubuntu
python-version: '3.8'
requirements: minimal
- os: macos
python-version: '3.8'
requirements: minimal
- os: windows
python-version: '3.8'
requirements: minimal

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
condarc-file: ci/condarc
use-mamba: true
python-version: ${{ matrix.python-version }}
environment-file: ci/requirements.yml
environment-file: ci/requirements-${{ matrix.requirements }}.yml
activate-environment: xarray-extras

- name: Install Linux compile env
shell: bash -l {0}
if: ${{ matrix.os == 'linux' }}
run: mamba install gcc_linux-64

- name: Install MacOS compile env
shell: bash -l {0}
if: ${{ matrix.os == 'macosx' }}
run: mamba install clang_osx-64

- name: Show conda options
shell: bash -l {0}
run: conda config --show

- name: conda info
shell: bash -l {0}
run: conda info

- name: conda list
shell: bash -l {0}
run: conda list

- name: Install
shell: bash -l {0}
run: python -m pip install --no-deps -e .

- name: pytest
shell: bash -l {0}
run: |
pytest -v --cov=xarray_extras --cov-report term-missing
coverage xml
run: py.test --verbose --cov=TEMPLATE --cov-report=xml

- name: codecov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
*.py[cod]
*.pyc
__pycache__

# C extensions
*.so

# Packages
.eggs
*.egg
*.egg-info
.eggs
dist
build
eggs
Expand All @@ -23,11 +23,12 @@ lib64
pip-log.txt

# Unit test / coverage reports
.coverage
.coverage*
coverage.xml
.tox
nosetests.xml
.cache
.mypy_cache
.mypy_cache/
.ropeproject/
.tags*
.testmon*
Expand Down Expand Up @@ -55,9 +56,7 @@ dask-worker-space/
Icon*

.ipynb_checkpoints
xarray_extras/version.py

doc/_build
_build
mydask.png
Untitled.ipynb
htmlcov/
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,30 @@ repos:
- id: absolufy-imports
name: absolufy-imports
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
language_version: python3
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py38-plus
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 23.12.1
hooks:
- id: black
language_version: python3
exclude: versioneer.py
args:
- --target-version=py38
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: mambaforge-22.9

conda:
environment: ci/requirements-docs.yml

python:
install:
- method: pip
path: .

sphinx:
builder: html
configuration: doc/conf.py
fail_on_warning: false
Loading

0 comments on commit fc0138c

Please sign in to comment.