Skip to content

Commit

Permalink
[MRG] Separate Lint and Tests + codecov configuration (#135)
Browse files Browse the repository at this point in the history
* separate Lint and tests

* try again

* Introduce linting error

* test pre-commit

* ignoe coddecov.yaml

---------

Co-authored-by: Oleksii Kachaiev <kachayev@gmail.com>
  • Loading branch information
rflamary and kachayev committed Mar 5, 2024
1 parent db8e6ce commit 35a3897
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 5 deletions.
38 changes: 33 additions & 5 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,39 @@ on: # yamllint disable-line rule:truthy
- '**'

jobs:

Lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:

# Install skada
- name: Checking Out Repository
uses: actions/checkout@v2
# Cache 'skada' datasets
- name: Create/Restore Skada Data Cache
id: cache-skada_datasets
uses: actions/cache@v2
with:
path: ~/skada_datasets
key: ${{ runner.os }}-v3
# Install Python & Packages
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: which python
- name: Lint with pre-commit
run: |
pip install pre-commit
pre-commit install --install-hooks
pre-commit run --all-files
Test-minimal:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -43,11 +76,6 @@ jobs:
python -m pip install --user --upgrade --progress-bar off pip
python -m pip install --user -r requirements.txt
python -m pip install --user --upgrade pytest pytest-cov codecov
- name: pre-commit
run: |
pip install pre-commit
pre-commit install --install-hooks
pre-commit run --all-files
- name: Install 'skada' package
run: |
python -m pip install --user -e .
Expand Down
1 change: 1 addition & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extends: default
ignore: |
.github/workflows/testing.yml
.circleci/config.yml
codecov.yml
rules:
line-length: disable
Expand Down
46 changes: 46 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Docs ref: https://docs.codecov.io/docs/codecovyml-reference
# Validation check: $ curl --data-binary @codecov.yml https://codecov.io/validate


codecov:
bot: "codecov-io"
strict_yaml_branch: "yaml-config"
require_ci_to_pass: yes
notify:
wait_for_ci: yes

coverage:
precision: 2
round: down
range: "90...100"
status:
project:
default:
base: auto # target to compare against
target: auto # target "X%" coverage to hit on project
threshold: 0.5% # allow this much decrease from base
if_ci_failed: error
patch:
default:
base: auto # target to compare against
target: 50% # target "X%" coverage to hit on patch
# threshold: 50% # allow this much decrease on patch
changes: false

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

# https://docs.codecov.io/docs/ignoring-paths
# ignore:
# - "ot/helpers/openmp_helpers.py"

# https://docs.codecov.io/docs/pull-request-comments
comment:
layout: header, diff, sunburst, uncovered
behavior: default
require_changes: true # if true: only post the comment if coverage changes

0 comments on commit 35a3897

Please sign in to comment.