Generate coverage for tests
This commit is contained in:
26
.github/workflows/test-verific.yml
vendored
26
.github/workflows/test-verific.yml
vendored
@@ -47,7 +47,7 @@ jobs:
|
||||
|
||||
- name: Build Yosys
|
||||
run: |
|
||||
make config-clang
|
||||
make config-gcov
|
||||
echo "ENABLE_VERIFIC := 1" >> Makefile.conf
|
||||
echo "ENABLE_VERIFIC_EDIF := 1" >> Makefile.conf
|
||||
echo "ENABLE_VERIFIC_LIBERTY := 1" >> Makefile.conf
|
||||
@@ -85,6 +85,30 @@ jobs:
|
||||
run: |
|
||||
make -C sby run_ci
|
||||
|
||||
- name: Run coverage
|
||||
if: ${{ github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' }}
|
||||
run: |
|
||||
make coverage
|
||||
|
||||
- name: Push coverage
|
||||
if: ${{ github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' }}
|
||||
run: |
|
||||
git clone https://x-access-token:${{ secrets.REPORTS_TOKEN }}@github.com/YosysHQ/reports.git out
|
||||
rm -rf out/coverage/main
|
||||
mkdir -p out/coverage/main
|
||||
cp -r coverage_html/* out/coverage/main/
|
||||
cd out
|
||||
# find . -name "*.html" -type f -print0 | xargs -0 sed -i -z 's#\(<td class="headerItem">Date:</td>[[:space:]]*<td class="headerValue">\)[^<]*\(</td>\)#\1\2#g'
|
||||
git config user.name "yosyshq-ci"
|
||||
git config user.email "105224853+yosyshq-ci@users.noreply.github.com"
|
||||
git add .
|
||||
if ! git diff --cached --quiet; then
|
||||
git commit -m "Update coverage"
|
||||
git push
|
||||
else
|
||||
echo "No changes to commit"
|
||||
fi
|
||||
|
||||
test-pyosys:
|
||||
needs: pre_job
|
||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.repository_owner == 'YosysHQ' }}
|
||||
|
||||
1
Makefile
1
Makefile
@@ -1117,6 +1117,7 @@ coverage:
|
||||
./$(PROGRAM_PREFIX)yosys -qp 'help; help -all'
|
||||
rm -rf coverage.info coverage_html
|
||||
lcov --capture -d . --no-external -o coverage.info
|
||||
lcov --remove coverage.info '*/tests/various/*' '*/libs/*' -o coverage.info --ignore-errors unused
|
||||
genhtml coverage.info --output-directory coverage_html
|
||||
|
||||
clean_coverage:
|
||||
|
||||
Reference in New Issue
Block a user