Skip to content

Continuous Integration #1412

Continuous Integration

Continuous Integration #1412

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
schedule:
- cron: "59 21 * * *"
jobs:
testing:
name: (${{ matrix.os }}, ${{ matrix.environment-file }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os: ["ubuntu-latest"]
environment-file:
[
311-oldest,
311-latest,
311-numba-latest,
312-latest,
312-numba-latest,
313-latest,
313-numba-latest,
313-dev,
]
include:
- environment-file: 313-latest
os: macos-13 # Intel
- environment-file: 313-numba-latest
os: macos-13 # Intel
- environment-file: 313-latest
os: macos-14 # Apple Silicon
- environment-file: 313-numba-latest
os: macos-14 # Apple Silicon
- environment-file: 313-latest
os: windows-latest
- environment-file: 313-numba-latest
os: windows-latest
fail-fast: false
steps:
- name: checkout repo
uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: setup micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ci/${{ matrix.environment-file }}.yaml
micromamba-version: 'latest'
- name: environment info
run: |
micromamba info
micromamba list
- name: spatial versions
run: |
python -c "import geopandas; geopandas.show_versions();"
- name: Download test files
run: |
python -c '
import libpysal
libpysal.examples.fetch_all()
'
- name: Run pytest
run: |
pytest \
mapclassify \
-r a \
-v \
-n logical \
--color yes \
--cov-append \
--cov mapclassify \
--cov-report xml \
--cov-report term-missing
- name: run docstring tests
if: contains(matrix.environment-file, '312-numba-latest') && contains(matrix.os, 'ubuntu')
run: |
pytest \
mapclassify \
--doctest-only \
-v \
-r a \
-n logical \
--color yes \
--cov-append \
--cov mapclassify \
--cov-report xml . \
--cov-report term-missing
- name: zip resultant image comparisons - Ubuntu & macOS
run: zip result_images.zip result_images -r
if: matrix.os != 'windows-latest' && (success() || failure())
- name: zip resultant image comparisons - Windows
shell: powershell
run: Compress-Archive -Path result_images -Destination result_images.zip
if: matrix.os == 'windows-latest' && (success() || failure())
- name: archive & upload resultant image comparisons
uses: actions/upload-artifact@v4
with:
name: result_images-${{ matrix.os }}-${{ matrix.environment-file }}
path: result_images.zip
if: success() || failure()
- name: codecov (${{ matrix.os }}, ${{ matrix.environment-file }})
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}