Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Setup GitHub Action Continuous Integration tests #45

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
55 changes: 55 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ dependencies = [
[project.optional-dependencies]
test = [
"dask",
"netcdf",
"pooch",
"pytest",
]

Expand Down
Loading