Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codecov comments added on PR opens/changes #414

Merged
merged 49 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
385ef91
First attempt to get codecov running on PR open/change
cstavitsky Mar 6, 2024
c865c99
update codecov comment, remove unnecessary part of codecov workflow
cstavitsky Mar 6, 2024
8f728c1
replace existing codecov.yml stuff i accidentally overrode
cstavitsky Mar 6, 2024
94ce5a7
add flag data in GH action
cstavitsky Mar 6, 2024
017b8c6
attempt to get flags working
cstavitsky Mar 6, 2024
788af51
attempt at flags #2
cstavitsky Mar 6, 2024
e60e5a7
attempt to increase project coverage by ignoring directories
cstavitsky Mar 8, 2024
6035dc8
try to change project coverage via ignore
cstavitsky Mar 8, 2024
55e8c8b
implement 'ignore' flag indented
cstavitsky Mar 8, 2024
7fb9fd4
ignore round 3
cstavitsky Mar 8, 2024
7a4627c
round 4 ignore
cstavitsky Mar 8, 2024
a7e6602
trigger rerun
cstavitsky Mar 8, 2024
5968fcd
remove ignore
cstavitsky Mar 8, 2024
110c3fb
fix yaml syntax error
cstavitsky Mar 8, 2024
cca3d3b
add unit test for DB
cstavitsky Mar 15, 2024
378cc78
test move
cstavitsky Mar 15, 2024
30b1753
ensure flask installed
cstavitsky Mar 15, 2024
46bf1d0
...
cstavitsky Mar 15, 2024
d2291af
fix invalid yaml syntax
cstavitsky Mar 18, 2024
640c5be
remove not-working chatgpt test
cstavitsky Mar 18, 2024
4294d4c
attempt to add untested code
cstavitsky Mar 18, 2024
11cbc89
Reattempt ignoregit status
cstavitsky Mar 21, 2024
d308d18
experimenting w ignore
cstavitsky Mar 21, 2024
fc61c30
more ignore..
cstavitsky Mar 21, 2024
fef8c00
Merge branch 'master' into codecov_runs_on_PR
cstavitsky Mar 21, 2024
2a4d872
codecov yml update
cstavitsky Mar 22, 2024
72abf0f
Merge branch 'master' into codecov_runs_on_PR
cstavitsky Mar 22, 2024
f668612
Merge branch 'codecov_runs_on_PR' of https://github.com/sentry-demos/…
cstavitsky Mar 22, 2024
058dde9
bump node version to 18 to prevent failing gh action
cstavitsky Mar 22, 2024
f45a7bd
work to rule out incorrect ignore syntax
cstavitsky Mar 22, 2024
5242e9e
Update .github/workflows/run_codecov_on_pull_request.yml
cstavitsky Mar 22, 2024
8a6dff9
try to rule out incorrect ignore syntax
cstavitsky Mar 22, 2024
85dedb5
Merge branch 'codecov_runs_on_PR' of https://github.com/sentry-demos/…
cstavitsky Mar 22, 2024
fa18140
expand ignored files
cstavitsky Mar 22, 2024
0859db0
add laravel dir to ignore to see if test coverage affected
cstavitsky Mar 22, 2024
767d6db
ignore add'l react directories
cstavitsky Mar 22, 2024
a7e5ee1
ignore more react code, all flask code
cstavitsky Mar 22, 2024
f61a49f
ignore auxiliary folders, unsure if this will make a difference
cstavitsky Mar 22, 2024
9c3ca85
Merge branch 'master' into codecov_runs_on_PR
cstavitsky Mar 25, 2024
0e5cbe4
remove most ignored dirs
cstavitsky Mar 25, 2024
b94c296
Merge branch 'codecov_runs_on_PR' of https://github.com/sentry-demos/…
cstavitsky Mar 25, 2024
f5dadf8
Merge branch 'master' into codecov_runs_on_PR
cstavitsky Apr 5, 2024
d5a836e
Upload coverage reports for each flag separately
cstavitsky Apr 12, 2024
a939347
Merge branch 'codecov_runs_on_PR' of https://github.com/sentry-demos/…
cstavitsky Apr 12, 2024
25ee22c
Merge branch 'master' into codecov_runs_on_PR
cstavitsky Apr 12, 2024
4483c29
fix copypaste error
cstavitsky Apr 12, 2024
f34a166
Merge branch 'codecov_runs_on_PR' of https://github.com/sentry-demos/…
cstavitsky Apr 12, 2024
ce03fda
run tests and upload for each flag in one step
cstavitsky Apr 12, 2024
ce85abd
remove ignore
cstavitsky Apr 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/run_codecov_on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: codecov.yml
# Run Codecov on PR open or change
on: pull_request
jobs:
codecov:
runs-on: ubuntu-20.04

steps:
- name: Check out this repository code
uses: actions/checkout@v3
with:
path: empower
fetch-depth: 0

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Run React tests
run: |
npm install
npm test -- --coverage
working-directory: ./empower/react
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: react

- name: Run Python Tests
run: |
pip install -U pytest
pip install pytz
pip install pytest-codecov
pytest --cov=. --cov-report=xml
working-directory: ./empower/flask/src
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: flask

- run: echo "Job status is ${{ job.status }}."
40 changes: 40 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# cat codecov.yml | curl --data-binary @- https://codecov.io/validate
fixes:
- "empower/::"

coverage:
status:
project:
default:
informational: true
target: 50%
patch:
react:
informational: true
target: 80%
flags:
- react
flask:
informational: true
target: 50%
flags:
- flask

github_checks:
annotations: true

comment:
layout: "newheader, diff, flags, files"
require_changes: false #if true: only post the comment if coverage changes
require_base: false # [yes :: must have a base report to post]
require_head: true # [yes :: must have a head report to post]
show_carryforward_flags: true
# show_critical_paths: true # affects labeled critical files -- leaving out for now
hide_comment_details: true # collapse 'detailed info' for PR comment

flags:
flask:
carryforward: true
paths:
- flask
react:
carryforward: true
paths:
- react
3 changes: 3 additions & 0 deletions flask/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ def get_iterator(n):

def yuval(text):
return ""

def chris():
return ""
Loading