ci: Fix pin for cibuildwheel when building matrix #98
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
pull_request: | |
schedule: | |
# 10th of each month | |
- cron: "0 0 10 * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
if: github.repository == 'scitools/cartopy' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.10', '3.11', '3.12', '3.13-dev'] | |
use-network: [true] | |
include: | |
- os: ubuntu-latest | |
python-version: '3.11' | |
use-network: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Minimum packages | |
if: | | |
matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' && | |
(github.event_name == 'push' || github.event_name == 'pull_request') | |
id: minimum-packages | |
run: | | |
pip install cython==0.29.28 matplotlib==3.6 numpy==1.23 owslib==0.27 pyproj==3.3.1 scipy==1.9 shapely==1.8 pyshp==2.3.1 | |
- name: Coverage packages | |
id: coverage | |
# 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 Nightlies | |
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
run: | | |
# Install Nightly builds from Scientific Python | |
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple matplotlib pyproj scipy shapely | |
- name: Install Cartopy | |
id: install | |
run: | | |
pip install -e .[test] | |
python -c "import cartopy; print('Version ', cartopy.__version__)" | |
- name: Install extras | |
# Default is to install just the minimum testing requirements, | |
# but we want to get as much coverage as possible. | |
if: steps.minimum-packages.conclusion == 'skipped' | |
run: | | |
pip install .[ows,plotting,speedups] | |
- name: Testing | |
id: test | |
if: matrix.use-network | |
# we need to force bash to use line continuations on Windows | |
shell: bash | |
run: | | |
# Check that the downloader tool at least knows where to get the data from (but don't actually download it) | |
python -m cartopy.feature.download gshhs physical --dry-run | |
# It should also be available as a script | |
cartopy_feature_download gshhs physical --dry-run | |
CARTOPY_GIT_DIR=$PWD | |
pytest -rfEsX -n 4 \ | |
--color=yes \ | |
--mpl --mpl-generate-summary=html \ | |
--mpl-results-path="cartopy_test_output-${{ matrix.os }}-${{ matrix.python-version }}" \ | |
--pyargs cartopy ${EXTRA_TEST_ARGS} | |
- name: No Network Tests | |
# Ensure any test that needs network access has been marked as such | |
if: ${{ ! matrix.use-network }} | |
run: | | |
pip install pytest-socket | |
pytest -rfEsX -n 4 \ | |
--color=yes \ | |
--pyargs cartopy -m "not natural_earth and not network" --disable-socket | |
- name: Coveralls | |
if: steps.coverage.conclusion == 'success' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | |
coveralls --service=github | |
- name: Upload image results | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
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, pyproj, 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 }} |