diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml new file mode 100644 index 0000000..51ab350 --- /dev/null +++ b/.github/workflows/ci-tests.yml @@ -0,0 +1,55 @@ +name: Tests + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +permissions: + contents: read + +jobs: + test: + name: ${{ matrix.os }} - Python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ["3.10", "3.12"] + os: [ubuntu-24.04] + defaults: + run: + shell: bash -l {0} + + steps: + # Checkout current git repository + - name: Checkout + uses: actions/checkout@v4.1.7 + + # Install Micromamba with conda-forge dependencies + - name: Setup Micromamba + uses: mamba-org/setup-micromamba@v1.9.0 + with: + environment-name: cupy-xarray + condarc: | + channels: + - conda-forge + - nodefaults + create-args: >- + cupy-core + dask + netcdf4 + pip + pooch + python=${{ matrix.python-version }} + pytest + xarray + + # Install the package that we want to test + - name: Install the package + run: python -m pip install . + + # Run the unit tests + - name: Test with pytest + run: | + pytest --verbose cupy_xarray/tests/ diff --git a/pyproject.toml b/pyproject.toml index be870da..299775d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,8 @@ dependencies = [ [project.optional-dependencies] test = [ "dask", + "netcdf", + "pooch", "pytest", ]