Skip to content

Commit

Permalink
Merge pull request #224 from knaaptime/testing
Browse files Browse the repository at this point in the history
update testing
  • Loading branch information
knaaptime authored Mar 17, 2024
2 parents f431b1d + ed36577 commit 9f5714c
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 41 deletions.
95 changes: 56 additions & 39 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,77 @@
name: Unit Tests
name: Tests

on:
push:
branches:
- '*'
branches: [main]
pull_request:
branches:
- '*'
schedule:
- cron: '59 23 * * *'
- cron: "0 0 * * 1,4"
workflow_dispatch:
inputs:
version:
description: Manual Unittest Run
default: test
required: false

jobs:
unittests:
name: CI (${{ matrix.os }}-${{ matrix.environment-file }})
Tests:
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
continue-on-error: false
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
environment-file: [.ci/39.yml, .ci/310.yml, .ci/311.yml]
experimental: [false]
fail-fast: [false]

os: [ubuntu-latest]
environment-file:
- ci/310.yml
- ci/311.yml
- ci/312.yml
include:
- environment-file: ci/311.yml
os: macos-latest
- environment-file: ci/311.yml
os: macos-14 # Apple Silicon
- environment-file: ci/311.yml
os: windows-latest
defaults:
run:
shell: bash -l {0}

steps:
- name: checkout repo
uses: actions/checkout@v2

- uses: actions/checkout@v4

- name: setup micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'

- name: reinstall segregation - bash
shell: bash -l {0}
run: pip install -e . --no-deps --force-reinstall
if: matrix.os != 'windows-latest'

- name: reinstall segregation - powershell
shell: powershell
run: pip install -e . --no-deps --force-reinstall
if: matrix.os == 'windows-latest'

- name: run pytest - bash
shell: bash -l {0}
run: pytest -v segregation --cov=segregation --cov-report=xml
if: matrix.os != 'windows-latest'

- name: run pytest - powershell
shell: powershell
run: pytest -v segregation --cov=segregation --cov-report=xml
if: matrix.os == 'windows-latest'


- name: Test segregation
run: |
pytest \
segregation \
-v \
-r a \
--color yes \
--cov segregation \
--cov-append \
--cov-report term-missing \
--cov-report xml \
- name: codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
name: segregation-codecov

- name: Generate and publish the report
if: |
failure()
&& steps.status.outcome == 'failure'
&& github.event_name == 'schedule'
&& github.repository_owner == 'pysal'
uses: xarray-contrib/issue-from-pytest-log@v1
with:
log-path: pytest-log.jsonl
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .ci/39.yml → ci/312.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: test
channels:
- conda-forge
dependencies:
- python=3.9
- python=3.12
- deprecation
- geopandas>=0.9
- joblib
Expand Down Expand Up @@ -41,4 +41,4 @@ dependencies:
- sphinxcontrib-bibtex
- sphinx_bootstrap_theme
- watermark
- black
- black

0 comments on commit 9f5714c

Please sign in to comment.