|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + schedule: |
| 11 | + - cron: "0 0 * * *" |
| 12 | + |
| 13 | +jobs: |
| 14 | + |
| 15 | + test: |
| 16 | + name: ${{ matrix.python-version }}-build |
| 17 | + runs-on: ubuntu-latest |
| 18 | + defaults: |
| 19 | + run: |
| 20 | + shell: bash -l {0} |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + python-version: ["3.9", "3.10", "3.11", "3.12"] |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - name: Create conda environment |
| 28 | + uses: mamba-org/provision-with-micromamba@main |
| 29 | + with: |
| 30 | + cache-downloads: true |
| 31 | + micromamba-version: 'latest' |
| 32 | + environment-file: ci/environment.yml |
| 33 | + extra-specs: | |
| 34 | + python=${{ matrix.python-version }} |
| 35 | +
|
| 36 | + - name: Conda info |
| 37 | + run: conda info |
| 38 | + |
| 39 | + - name: Install datatree |
| 40 | + run: | |
| 41 | + python -m pip install -e . --no-deps --force-reinstall |
| 42 | +
|
| 43 | + - name: Conda list |
| 44 | + run: conda list |
| 45 | + |
| 46 | + - name: Running Tests |
| 47 | + run: | |
| 48 | + python -m pytest --cov=./ --cov-report=xml --verbose |
| 49 | +
|
| 50 | + - name: Upload code coverage to Codecov |
| 51 | + |
| 52 | + with: |
| 53 | + file: ./coverage.xml |
| 54 | + flags: unittests |
| 55 | + env_vars: OS,PYTHON |
| 56 | + name: codecov-umbrella |
| 57 | + fail_ci_if_error: false |
| 58 | + |
| 59 | + |
| 60 | + test-upstream: |
| 61 | + name: ${{ matrix.python-version }}-dev-build |
| 62 | + runs-on: ubuntu-latest |
| 63 | + defaults: |
| 64 | + run: |
| 65 | + shell: bash -l {0} |
| 66 | + strategy: |
| 67 | + matrix: |
| 68 | + python-version: ["3.9", "3.10", "3.11", "3.12"] |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + |
| 72 | + - name: Create conda environment |
| 73 | + uses: mamba-org/provision-with-micromamba@main |
| 74 | + with: |
| 75 | + cache-downloads: true |
| 76 | + micromamba-version: 'latest' |
| 77 | + environment-file: ci/environment.yml |
| 78 | + extra-specs: | |
| 79 | + python=${{ matrix.python-version }} |
| 80 | +
|
| 81 | + - name: Conda info |
| 82 | + run: conda info |
| 83 | + |
| 84 | + - name: Install dev reqs |
| 85 | + run: | |
| 86 | + python -m pip install --no-deps --upgrade \ |
| 87 | + git+https://github.com/pydata/xarray \ |
| 88 | + git+https://github.com/Unidata/netcdf4-python |
| 89 | +
|
| 90 | + python -m pip install -e . --no-deps --force-reinstall |
| 91 | +
|
| 92 | + - name: Conda list |
| 93 | + run: conda list |
| 94 | + |
| 95 | + - name: Running Tests |
| 96 | + run: | |
| 97 | + python -m pytest --verbose |
0 commit comments