diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 7d8f2a2b..13367730 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -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 diff --git a/.ci/310.yml b/ci/310.yml similarity index 100% rename from .ci/310.yml rename to ci/310.yml diff --git a/.ci/311.yml b/ci/311.yml similarity index 100% rename from .ci/311.yml rename to ci/311.yml diff --git a/.ci/39.yml b/ci/312.yml similarity index 95% rename from .ci/39.yml rename to ci/312.yml index 8866c7e6..6f03c286 100644 --- a/.ci/39.yml +++ b/ci/312.yml @@ -2,7 +2,7 @@ name: test channels: - conda-forge dependencies: - - python=3.9 + - python=3.12 - deprecation - geopandas>=0.9 - joblib @@ -41,4 +41,4 @@ dependencies: - sphinxcontrib-bibtex - sphinx_bootstrap_theme - watermark - - black \ No newline at end of file + - black