Skip to content

Commit 4dadf9f

Browse files
committed
Add coverage report
1 parent 857931e commit 4dadf9f

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

.github/workflows/test-examples.yml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
required: true
88

99
jobs:
10-
test-submit:
10+
test-all:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
@@ -65,12 +65,47 @@ jobs:
6565
- name: Run tests
6666
working-directory: ${{ env.test_repo_path }}
6767
run: |
68-
pdm test
68+
pdm test-cov
69+
70+
- name: Run sim
71+
working-directory: ${{ env.test_repo_path }}
72+
run: |
73+
pdm run coverage run -a chipflow pin lock
74+
pdm run coverage run -a chipflow sim
75+
pdm run coverage run -a chipflow software
76+
./build/sim/sim_soc
6977
7078
- name: Submit build ${{ env.is_dry }}
7179
working-directory: ${{ env.test_repo_path }}/${{ matrix.repo.design }}
7280
run: |
73-
pdm run chipflow pin lock
74-
pdm run chipflow silicon submit --wait $DRY | cat
81+
pdm run coverage run -a chipflow pin lock
82+
pdm run coverage run -a chipflow silicon submit --wait $DRY | cat
83+
mv .coverage .coverage-${{matrix.repo.name}}-${{matrix.dry}}
7584
env:
7685
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}
86+
87+
- name: Upload coverage artefact
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: coverage-${{matrix.repo.name}}-${{matrix.dry}}
91+
path: .coverage-${{matrix.repo.name}}-${{matrix.dry}}
92+
93+
coverage:
94+
needs: [test-all]
95+
steps:
96+
- name: Fetch coverage artefacts
97+
uses: actions/download-artifact@v4
98+
with:
99+
path: coverage/
100+
merge-multiple: true
101+
- name: Combine coverage artefacts
102+
run: pdm coverage combine coverage/
103+
- name: Generate coverage report
104+
run: pdm coverage html
105+
- name: upload html coverage artifact
106+
uses: actions/upload-pages-artifact@v1
107+
with:
108+
path: './htmlcov/'
109+
- name: deploy to Github Pages
110+
uses: actions/deploy-pages@v2
111+
id: deployment

0 commit comments

Comments
 (0)