Skip to content

Commit

Permalink
Add CI test for xarray > 2024.3
Browse files Browse the repository at this point in the history
Should allows to monitor if pydata/xarray#8909 is solved
  • Loading branch information
gmaze committed Oct 16, 2024
1 parent aca5d04 commit 931a73a
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 1 deletion.
98 changes: 98 additions & 0 deletions .github/workflows/pytests-upstream-xarray.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: CI tests - Xarray > 2024.3
# Daily tests with all un-pinned dependencies
# Allows to be warned when argopy fail tests due to updates in dependencies

on:
schedule:
- cron: "0 0 * * *" # Daily “At 00:00” UTC
workflow_dispatch: # allows you to trigger the workflow run manually

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

jobs:

all-free-but-xr:
# CI tests for environments with all possible requirements in free versions

name: All - Free - Py${{matrix.python-version}} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: [detect-ci-trigger, detect-ci-skip]
if: |
always()
&& (
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
)
defaults:
run:
shell: bash -l {0}
# timeout-minutes: 45
strategy:
fail-fast: true
matrix:
python-version: ["3.12"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-region: us-west-1
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/ga-ci-tests-argopy-01

- name: Set environment variables
run: |
echo "CONDA_ENV_FILE=ci/requirements/py${{matrix.python-version}}-all-free-xarray-check.yml" >> $GITHUB_ENV
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Setup Micromamba ${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.10-0'
environment-name: argopy-tests
environment-file: ${{ env.CONDA_ENV_FILE }}
init-shell: bash
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
create-args: >-
python=${{matrix.python-version}}
pytest-reportlog
- name: Install argopy
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
micromamba info
micromamba list
- name: Test with pytest
run: |
pytest -ra -v -s -c argopy/tests/pytest.ini --durations=10 \
--report-log output-${{ matrix.python-version }}-log.jsonl \
test_fetchers_data_erddap.py
- name: Generate and publish a report on failure
if: |
failure()
&& steps.status.outcome == 'failure'
&& github.repository_owner == 'euroargodev'
uses: xarray-contrib/issue-from-pytest-log@main
with:
log-path: output-${{ matrix.python-version }}-log.jsonl

- name: Save tests log as artifact
uses: actions/upload-artifact@v4
with:
name: Argopy-Tests-All-${{matrix.python-version}}-${{matrix.os}}
path: output-${{ matrix.python-version }}-log.jsonl
retention-days: 90
2 changes: 1 addition & 1 deletion .github/workflows/pytests-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

steps:
Expand Down
1 change: 1 addition & 0 deletions ci/envs_manager
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ source ~/miniconda3/etc/profile.d/conda.sh
declare -A ENV_LIST=(
['argopy-base']="requirements/py3.11-all-free.yml"
['argopy-coiled']="requirements/py3.11-coiled-free.yml"
['argopy-xr-check']="requirements/py3.12-all-free-xarray-check.yml"

['argopy-docs-dev']="requirements/py3.9-docs-dev.yml"
['argopy-docs-rtd']="requirements/py3.9-docs-rtd.yml"
Expand Down
61 changes: 61 additions & 0 deletions ci/requirements/py3.12-all-free-xarray-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: argopy-tests
channels:
- conda-forge
dependencies:
- python = 3.12

# CORE:
- aiohttp
- decorator
- erddapy
- fsspec
- netCDF4
- packaging
- requests
- scipy
- toolz
- xarray > 2024.3 # to test if https://github.com/pydata/xarray/issues/8909 is solved

# EXT.UTIL:
- boto3
- gsw
- s3fs > 2023.12.12
- tqdm
- zarr

# EXT.PERF:
- dask
- distributed
- h5netcdf
- pyarrow

# EXT.PLOT:
- IPython
- cartopy
- ipykernel
- ipywidgets
- matplotlib
- pyproj
- seaborn

# DEV:
- aiofiles
- black
- bottleneck
- cfgrib
- cftime
- codespell
- flake8
- numpy
- pandas
- pip
- pytest
- pytest-cov
- pytest-env
- pytest-localftpserver
- setuptools
# - sphinx

# PIP:
- pip:
- pytest-reportlog

0 comments on commit 931a73a

Please sign in to comment.