diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7a6fdf4..26acf5c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,29 +5,66 @@ on: - pull_request jobs: - build: - runs-on: ubuntu-latest + test: + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: true matrix: + os: ["windows-latest", "ubuntu-latest", "macos-latest"] python-version: ["3.10", "3.11", "3.12"] experimental: [false] + include: + - python-version: "3.12" + os: "ubuntu-latest" + experimental: true + env: + PYTHON_VERSION: ${{ matrix.python-version }} + OS: ${{ matrix.os }} + UNSTABLE: ${{ matrix.experimental }} + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + steps: - name: Checkout source uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + + - name: Setup Conda Environment + uses: conda-incubator/setup-miniconda@v3 with: + environment-file: continuous_integration/environment.yaml + miniforge-version: latest python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install -U pytest pytest-cov numpy pyresample pyorbital six pyyaml defusedxml - - name: Install pytroll-collectors + activate-environment: test-environment + + - name: Install unstable dependencies + if: matrix.experimental == true + shell: bash -l {0} run: | - pip install --no-deps -e . + sudo apt-get install \ + gcc \ + python3-dev; \ + python -m pip install \ + -f https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ \ + --no-deps --pre --upgrade \ + matplotlib \ + numpy \ + pandas \ + geopandas \ + scipy; \ + python -m pip install \ + --no-deps --upgrade \ + git+https://github.com/dask/dask \ + git+https://github.com/dask/distributed \ + git+https://github.com/Unidata/cftime \ + git+https://github.com/pydata/bottleneck \ + git+https://github.com/pydata/xarray; + + - name: Run tests + shell: bash -l {0} run: | pytest --cov=trollsched trollsched/tests --cov-report=xml + - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml new file mode 100644 index 0000000..03a619f --- /dev/null +++ b/continuous_integration/environment.yaml @@ -0,0 +1,39 @@ +name: test-environment +channels: + - conda-forge +dependencies: + - xarray + - dask + - distributed + - toolz + - sphinx + - matplotlib + - mpl_toolkits + - cartopy + - scipy + - pyyaml + - coveralls + - coverage + - codecov + - behave + - netcdf4 + - paramiko + - oauthlib + - watchdog + - s3fs + - shapely + - pyproj + - pandas + - geopandas + - mock + - pytest + - pytest-cov + - responses + - platformdirs + - defusedxml + - pyorbital + - pyresample + - trollsift + - pip + - pip: + - posttroll