mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
Add dockerci target which builds badge and uploads to github pages
This commit is contained in:
parent
cfc1286874
commit
b2b7827e60
3 changed files with 25 additions and 18 deletions
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
|
|
@ -16,21 +16,17 @@ jobs:
|
|||
- name: Build
|
||||
run: make dockerbuild_cached && make docker
|
||||
working-directory: uvm32
|
||||
- name: Code Coverage Report
|
||||
uses: irongut/CodeCoverageSummary@v1.3.0
|
||||
- name: CI test
|
||||
run: make dockerci
|
||||
working-directory: uvm32
|
||||
- name: Setup Pages
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: actions/configure-pages@v4
|
||||
- name: Upload Artifact
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
filename: uvm32/test/coverage.xml
|
||||
badge: true
|
||||
fail_below_min: false
|
||||
format: markdown
|
||||
hide_branch_rate: false
|
||||
hide_complexity: true
|
||||
indicators: true
|
||||
output: both
|
||||
thresholds: '60 80'
|
||||
- name: Archive code coverage results
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: code-coverage-report
|
||||
path: code-coverage-results.md
|
||||
|
||||
path: uvm32/test/badge.svg
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
|
|
|
|||
6
Makefile
6
Makefile
|
|
@ -10,6 +10,9 @@ clean:
|
|||
(cd hosts && make clean)
|
||||
(cd apps && make clean)
|
||||
|
||||
ci:
|
||||
(cd test && make ci)
|
||||
|
||||
test:
|
||||
make -C test
|
||||
|
||||
|
|
@ -28,4 +31,7 @@ dockershell:
|
|||
docker:
|
||||
docker run -v `pwd`:/data -w /data --rm uvm32 make
|
||||
|
||||
dockerci:
|
||||
docker run -v `pwd`:/data -w /data --rm uvm32 make ci
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,13 +14,18 @@ CLEANCMD = $(foreach TEST,${TESTS},make -C ${TEST} clean &&)
|
|||
ifeq (,$(shell which gcovr))
|
||||
GCOVRCMD=echo Install gcovr for code coverage reports
|
||||
else
|
||||
GCOVRCMD=gcovr -r ../ --filter ".*uvm32.c" && gcovr -r ../ --filter ".*uvm32.c" --cobertura-pretty --cobertura coverage.xml
|
||||
GCOVRCMD=gcovr -r ../ --filter ".*uvm32.c"
|
||||
PERC=$(shell gcovr -r ../ --filter ".*uvm32.c" | grep uvm | awk '{print $$4}')
|
||||
endif
|
||||
|
||||
all:
|
||||
${RUNCMD} true
|
||||
@${GCOVRCMD}
|
||||
|
||||
ci:
|
||||
@${GCOVRCMD}
|
||||
curl "https://img.shields.io/badge/Code%20Coverage-${PERC}25-success?style=flat" > badge.svg
|
||||
|
||||
clean:
|
||||
${CLEANCMD} true
|
||||
rm -f coverage.xml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue