-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* CI: setup GHA * fix suffixes * avoid duplication * ignore tests in coverage * add linting pre-commit and check * fix pre-commit * use bash as a default shell * typo * include isort * remove linting and use pre-commit.ci instead * use pytest-reportlog * include pytest-reportlog in latest * add id to run tests
- Loading branch information
1 parent
fb78481
commit 5198341
Showing
6 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
schedule: | ||
- cron: "59 23 * * 3" | ||
|
||
jobs: | ||
Tests: | ||
name: ${{ matrix.os }}, ${{ matrix.environment-file }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
environment-file: [ci/latest.yaml] | ||
include: | ||
- environment-file: ci/dev.yaml | ||
os: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: setup micromamba | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
environment-file: ${{ matrix.environment-file }} | ||
micromamba-version: "latest" | ||
channel-priority: "flexible" | ||
|
||
- name: Install xvec | ||
run: pip install . | ||
|
||
- name: run tests | ||
id: status | ||
run: pytest -v . -m "not request" --cov=xvec --cov-append --cov-report term-missing --cov-report xml --color=yes --report-log pytest-log.jsonl | ||
|
||
- uses: codecov/codecov-action@v3 | ||
|
||
- name: Generate and publish the report | ||
if: | | ||
failure() | ||
&& steps.status.outcome == 'failure' | ||
&& github.event_name == 'schedule' | ||
&& github.repository_owner == 'martinfleis' | ||
uses: xarray-contrib/issue-from-pytest-log@v1 | ||
with: | ||
log-path: pytest-log.jsonl |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
files: 'xvec\/' | ||
repos: | ||
- repo: https://github.com/python/black | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 5.0.4 | ||
hooks: | ||
- id: flake8 | ||
language: python_venv | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
language_version: python3 | ||
|
||
ci: | ||
autofix_prs: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: xvec_dev | ||
channels: | ||
- conda-forge | ||
- conda-forge/label/shapely_dev | ||
dependencies: | ||
- python | ||
# to build from source | ||
- cython | ||
- geos | ||
# testing | ||
- pytest | ||
- pytest-cov | ||
- pytest-xdist | ||
- pytest-reportlog | ||
- pip | ||
- pip: | ||
- git+https://github.com/shapely/shapely.git@main | ||
- git+https://github.com/pydata/xarray.git@main |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: xvec | ||
channels: | ||
- conda-forge | ||
- conda-forge/label/shapely_dev | ||
dependencies: | ||
- python | ||
# required | ||
- shapely=2 | ||
- xarray | ||
# testing | ||
- pytest | ||
- pytest-cov | ||
- pytest-xdist | ||
- pytest-reportlog |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,7 @@ dependencies: | |
- numpydoc | ||
- pydata-sphinx-theme | ||
- geopandas | ||
# linting | ||
- flake8 | ||
- black | ||
- isort |
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