Skip to content

Commit

Permalink
chore: integrate codedev
Browse files Browse the repository at this point in the history
  • Loading branch information
elhoangvu committed Apr 16, 2024
1 parent 4176856 commit 80de3cc
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ env:
PYTHONPATH: src

jobs:
build:

run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -30,14 +29,29 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pyyaml
python -m pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
- name: Run ATS
uses: codecov/codecov-ats@v0
env:
CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Run tests
run: pytest --cov=./src --junitxml=./coverage.xml tests/
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: elhoangvu/dictrule
fail_ci_if_error: false
flags: smart-tests
verbose: true
plugins: pycoverage,compress-pycoverage
files: ./coverage.xml
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
27 changes: 27 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
codecov:
notify:
after_n_builds: 3
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

comment:
after_n_builds: 3
layout: "diff,flags,files"
behavior: default
require_changes: yes

github_checks:
annotations: true

flag_management:
individual_flags:
- name: smart-tests
carryforward: true
carryforward_mode: "labels"
statuses:
- type: "project"
- type: "patch"
3 changes: 3 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest
pytest-cov
PyYAML==6.0.1
5 changes: 0 additions & 5 deletions tox.ini

This file was deleted.

0 comments on commit 80de3cc

Please sign in to comment.