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

Move the C coverage to the CodeCov GitHub Action #3947

Merged
merged 6 commits into from
Oct 26, 2024
Merged
Changes from 3 commits
Commits
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
27 changes: 10 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ jobs:
if: matrix.coverage
run: sudo -H luarocks install cluacov

- name: Install codecov.io uploader
if: matrix.coverage == 'codecov'
run: wget -O /tmp/codecov-bash https://codecov.io/bash

# Check out repository to ${{ github.workspace }}
# Automatically picks the current branch/PR
- uses: actions/checkout@v2
Expand Down Expand Up @@ -308,7 +304,7 @@ jobs:
run: cd "${{ github.workspace }}/build" && make check-unit

- name: Run examples tests
run: cd "${{ github.workspace }}/build" && make check-examples
run: cd "${{ github.workspace }}/build" && make check-examples -j16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be -j$(nproc) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the examples tests are not CPU bound, they are I/O bound. For example, I use -j99 on my 16 thread desktop and it's 4x faster than -j17. As long as it doesn't take more ram than the VM has, the larger the number is, the faster it goes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment with this explanation?


- name: Run requires tests
if: matrix.coverage
Expand All @@ -322,15 +318,7 @@ jobs:
run: |
luacov

- name: Upload Lua code coverage report
if: matrix.coverage == 'codecov'
uses: codecov/codecov-action@v3
with:
files: "${{ github.workspace }}/build/luacov.report.out"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Upload C code coverage report
- name: Generate C coverage report
if: matrix.coverage == 'codecov'
run: |
# Report coverage for each .gcno file separately.
Expand All @@ -349,9 +337,14 @@ jobs:
# with Code Climate.
find "gcov.$i" -maxdepth 1 -type f -name '#usr#*.gcov' -delete
done

# Upload to Codecov.
bash /tmp/codecov-bash -X gcov -X coveragepy -F gcov

- name: Upload code coverage report
if: matrix.coverage == 'codecov'
uses: codecov/codecov-action@v3
with:
files: "${{ github.workspace }}/build/luacov.report.out"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# `check-qa` is the only test that doesn't get a coverage report, so it has to run after all of that.
- name: Run qa tests
Expand Down
Loading