diff --git a/.github/workflows/test-verific.yml b/.github/workflows/test-verific.yml index 132aac589..6e3284167 100644 --- a/.github/workflows/test-verific.yml +++ b/.github/workflows/test-verific.yml @@ -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#\(Date:[[:space:]]*\)[^<]*\(\)#\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' }} diff --git a/Makefile b/Makefile index 3c5c10cda..f6ba73375 100644 --- a/Makefile +++ b/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: