@@ -3,8 +3,8 @@ name: Build and run tests with Verific (Linux)
33on :
44 pull_request :
55 merge_group :
6- # push:
7- # branches: [ main ]
6+ push :
7+ branches : [ main ]
88 workflow_dispatch :
99
1010jobs :
1414 should_skip : ${{ steps.set_output.outputs.should_skip }}
1515 steps :
1616 - id : skip_check
17- if : ${{ github.event_name != 'merge_group' }}
18- uses : mmicko /skip-duplicate-actions@master
17+ if : ${{ github.event_name != 'merge_group' && github.event_name != 'push' }}
18+ uses : fkirc /skip-duplicate-actions@v5.3.2
1919 with :
2020 # don't run on documentation changes
2121 paths_ignore : ' ["**/README.md", "docs/**", "guidelines/**"]'
2525
2626 - id : set_output
2727 run : |
28- if [ "${{ github.event_name }}" = "merge_group" ]; then
28+ if [ "${{ github.event_name }}" = "merge_group" ] || [ "${{ github.event_name }}" = "push" ] ; then
2929 echo "should_skip=false" >> $GITHUB_OUTPUT
3030 else
3131 echo "should_skip=${{ steps.skip_check.outputs.should_skip }}" >> $GITHUB_OUTPUT
@@ -47,22 +47,18 @@ jobs:
4747 mkdir -p "${GITHUB_WORKSPACE}/coverage"
4848 echo "LLVM_PROFILE_FILE=${GITHUB_WORKSPACE}/coverage/coverage_%p.profraw" >> $GITHUB_ENV
4949 echo "LLVM_PROFILE_FILE_BUFFER_SIZE=0" >> $GITHUB_ENV
50-
51- - name : Skip generating files
52- if : ${{ github.event_name != 'merge_group' && github.event_name != 'workflow_dispatch' }}
53- run : |
54- echo "LLVM_PROFILE_FILE=/dev/null" >> $GITHUB_ENV
50+ echo "SEED=0" >> $GITHUB_ENV
5551
5652 - name : Build Yosys
5753 run : |
58- rm -rf build Configuration.cmake
54+ rm -rf build Configuration.cmake coverage
5955 echo 'set(CMAKE_C_COMPILER clang CACHE STRING "")' >> Configuration.cmake
6056 echo 'set(CMAKE_CXX_COMPILER clang++ CACHE STRING "")' >> Configuration.cmake
6157 echo 'set(YOSYS_COMPILER_LAUNCHER ccache CACHE STRING "")' >> Configuration.cmake
6258 echo 'set(YOSYS_ENABLE_COVERAGE ON CACHE BOOL "")' >> Configuration.cmake
6359 echo 'set(YOSYS_VERIFIC_DIR "/usr/local/src/verific_lib" CACHE STRING "")' >> Configuration.cmake
6460
65- cmake -C Configuration.cmake -B build . -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.local -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON - DCMAKE_BUILD_TYPE=Debug
61+ cmake -C Configuration.cmake -B build . -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.local -DCMAKE_BUILD_TYPE=Debug
6662 cmake --build build -j$procs
6763
6864 - name : Install Yosys
8076 run : |
8177 make -C sby install DESTDIR=${GITHUB_WORKSPACE}/.local PREFIX=
8278
79+ - name : Run unit tests
80+ run : |
81+ ctest --test-dir build/tests/unit --output-on-failure
82+
8383 - name : Run Yosys tests
8484 run : |
8585 make -C tests -j$procs vanilla-test
@@ -89,39 +89,37 @@ jobs:
8989 make -C tests/sva
9090 make -C tests/svtypes
9191
92- - name : Run SBY tests
93- if : ${{ github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' }}
94- run : |
95- make -C sby run_ci
96-
9792 - name : Run coverage
98- if : ${{ github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' }}
93+ if : ${{ github.event_name != 'merge_group'}}
9994 run : |
10095 make -C tests coverage
96+
97+ - name : Clean coverage
98+ run : |
10199 make -C tests clean_coverage
102100
103- - name : Push coverage
101+ - name : Upload coverage reports to Codecov
102+ if : ${{ github.event_name != 'merge_group'}}
103+ uses : codecov/codecov-action@v7
104+ with :
105+ token : ${{ secrets.CODECOV_TOKEN }}
106+ slug : YosysHQ/yosys
107+ files : build/coverage.info
108+ disable_search : true
109+
110+ - name : Skip generating files
104111 if : ${{ github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' }}
105112 run : |
106- git clone https://x-access-token:${{ secrets.REPORTS_TOKEN }}@github.com/YosysHQ/reports.git out
107- rm -rf out/coverage/main
108- mkdir -p out/coverage/main
109- cp -r coverage_html/* out/coverage/main/
110- cd out
111- # 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'
112- git config user.name "yosyshq-ci"
113- git config user.email "105224853+yosyshq-ci@users.noreply.github.com"
114- git add .
115- if ! git diff --cached --quiet; then
116- git commit -m "Update coverage"
117- git push
118- else
119- echo "No changes to commit"
120- fi
113+ echo "LLVM_PROFILE_FILE=/dev/null" >> $GITHUB_ENV
114+
115+ - name : Run SBY tests
116+ if : ${{ github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' }}
117+ run : |
118+ make -C sby run_ci
121119
122120 test-pyosys :
123121 needs : pre_job
124- if : ${{ needs.pre_job.outputs.should_skip != 'true' && github.repository_owner == 'YosysHQ' }}
122+ if : ${{ needs.pre_job.outputs.should_skip != 'true' && github.repository_owner == 'YosysHQ' && github.event_name != 'push' }}
125123 runs-on : [self-hosted, linux, x64, fast]
126124 steps :
127125 - name : Checkout Yosys
0 commit comments