Skip to content

Commit

Permalink
Merge pull request SciTools#2376 from rcomer/ci-nightly-tests
Browse files Browse the repository at this point in the history
CI: add scheduled testing against nightlies
  • Loading branch information
greglucas authored Apr 29, 2024
2 parents fadfa19 + b14a31e commit d57166c
Showing 1 changed file with 45 additions and 17 deletions.
62 changes: 45 additions & 17 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Tests

on: [push, pull_request]
on:
push:
pull_request:
schedule:
# 10th of each month
- cron: "0 0 10 * *"
workflow_dispatch:

jobs:
build:
Expand All @@ -12,13 +18,8 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, '3.10', '3.11', '3.12']
shapely-dev: [false]
use-network: [true]
include:
- os: ubuntu-latest
python-version: '3.11'
shapely-dev: true
use-network: true
- os: ubuntu-latest
python-version: '3.11'
use-network: false
Expand All @@ -35,28 +36,30 @@ jobs:
cache: 'pip'

- name: Minimum packages
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
if: |
matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest' &&
(github.event_name == 'push' || github.event_name == 'pull_request')
id: minimum-packages
run: |
pip install cython==0.29.24 matplotlib==3.5.3 numpy==1.21 owslib==0.24.1 pyproj==3.3.1 scipy==1.6.3 shapely==1.7.1 pyshp==2.3.1
- name: Coverage packages
id: coverage
# only want the coverage to be run on the latest ubuntu
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
# only want the coverage to be run on the latest ubuntu and for code changes i.e. push and pr
if: |
matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' &&
(github.event_name == 'push' || github.event_name == 'pull_request')
run: |
echo "CYTHON_COVERAGE=1" >> $GITHUB_ENV
# Also add doctest here to avoid windows runners which expect a different path separator
echo "EXTRA_TEST_ARGS=--cov=cartopy -ra --doctest-modules" >> $GITHUB_ENV
pip install cython
- name: Install Shapely dev
if: matrix.shapely-dev
- name: Install Nightlies
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
run: |
# Install Shapely from source on ubuntu
sudo apt-get update
sudo apt-get install -yy libgeos-dev
pip install git+https://github.com/shapely/shapely.git@main
# Install Nightly builds from Scientific Python
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple matplotlib scipy shapely
- name: Install Cartopy
id: install
Expand Down Expand Up @@ -108,5 +111,30 @@ jobs:
uses: actions/upload-artifact@v4
if: failure()
with:
name: image-failures-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.shapely-dev }}
path: cartopy_test_output-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.shapely-dev }}
name: image-failures-${{ matrix.os }}-${{ matrix.python-version }}
path: cartopy_test_output-${{ matrix.os }}-${{ matrix.python-version }}

# Separate dependent job to only upload one issue from the matrix of jobs
create-issue:
if: ${{ failure() && github.event_name == 'schedule' }}
needs: [build]
permissions:
issues: write
runs-on: ubuntu-latest
name: Create issue on failure

steps:
- name: Create issue on failure
uses: imjohnbo/issue-bot@v3
with:
title: "[TST] Upcoming dependency test failures"
body: |
The build with nightly wheels from matplotlib, scipy, shapely and their
dependencies has failed. Check the logs for any updates that need to be
made in cartopy.
https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
pinned: false
close-previous: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d57166c

Please sign in to comment.