From 3de96642f2b414f082ad8bd25a8b535e404bc96d Mon Sep 17 00:00:00 2001 From: Aaron Zuspan Date: Fri, 22 Aug 2025 18:08:40 -0700 Subject: [PATCH 1/3] Update CI - Run on pushes to main - Test in parallel - Run pre-commit checks --- .github/workflows/{tests.yml => ci.yml} | 23 +++++++++++++++++++++-- README.rst | 2 +- pyproject.toml | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) rename .github/workflows/{tests.yml => ci.yml} (64%) diff --git a/.github/workflows/tests.yml b/.github/workflows/ci.yml similarity index 64% rename from .github/workflows/tests.yml rename to .github/workflows/ci.yml index ac37ac1..1ac59ea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/ci.yml @@ -2,13 +2,19 @@ name: tests 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", ] From c7d18d2bb2bc6393d3686f36f515fd6271e04bfa Mon Sep 17 00:00:00 2001 From: Aaron Zuspan Date: Fri, 22 Aug 2025 18:09:48 -0700 Subject: [PATCH 2/3] Fix test warning --- test/test_xarray.py | 1 + 1 file changed, 1 insertion(+) 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 From f252c8aebdd783252d99919fd6ad2d326c8c67c8 Mon Sep 17 00:00:00 2001 From: Aaron Zuspan Date: Fri, 22 Aug 2025 18:11:14 -0700 Subject: [PATCH 3/3] Rename CI workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ac59ea..90c5ba6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: tests +name: ci on: workflow_dispatch: