diff --git a/.github/workflows/tests.yml b/.github/workflows/ci.yml similarity index 63% rename from .github/workflows/tests.yml rename to .github/workflows/ci.yml index ac37ac1..90c5ba6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,20 @@ -name: tests +name: ci on: workflow_dispatch: + push: + branches: + - main + paths-ignore: + - 'docs/**' + - '**.rst' pull_request: paths-ignore: - 'docs/**' - '**.rst' jobs: - build: + test: runs-on: ubuntu-latest strategy: @@ -29,4 +35,17 @@ jobs: env: EE_SERVICE_ACCOUNT: ${{ secrets.EE_SERVICE_ACCOUNT }} run: | - hatch run test:all + hatch run test:all -n 4 + + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Run pre-commit hooks + uses: pre-commit/action@v3.0.0 \ No newline at end of file diff --git a/README.rst b/README.rst index b23d33a..7d0613e 100644 --- a/README.rst +++ b/README.rst @@ -20,7 +20,7 @@ .. image:: https://readthedocs.org/projects/wxee/badge/?version=latest&style=flat :alt: Read the Docs :target: https://wxee.readthedocs.io/en/latest/?badge=latest -.. image:: https://github.com/aazuspan/wxee/actions/workflows/tests.yml/badge.svg +.. image:: https://github.com/aazuspan/wxee/actions/workflows/ci.yml/badge.svg :alt: Build status :target: https://github.com/aazuspan/wxee diff --git a/pyproject.toml b/pyproject.toml index 1defe8d..2b84bf7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,6 +74,7 @@ dependencies = [ "mock", "pytest", "pytest-cov", + "pytest-xdist", "requests_mock", ] diff --git a/test/test_xarray.py b/test/test_xarray.py index ba81f80..0e62beb 100644 --- a/test/test_xarray.py +++ b/test/test_xarray.py @@ -2,6 +2,7 @@ import mock import pytest +import netCDF4 # noqa (avoids warning https://github.com/pydata/xarray/issues/7259) import xarray as xr