mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
Add CI workflow to create a coverage badge via github pages
This commit is contained in:
parent
cfc1286874
commit
079cf2c9bd
4 changed files with 44 additions and 20 deletions
45
.github/workflows/build.yml
vendored
45
.github/workflows/build.yml
vendored
|
|
@ -2,35 +2,46 @@ name: CI
|
|||
|
||||
on: [push, pull_request]
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ${{matrix.os}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: uvm32
|
||||
- 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
|
||||
uses: actions/configure-pages@v5
|
||||
- name: Upload Artifact
|
||||
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
|
||||
name: github-pages
|
||||
- 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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
# 🌱 uvm32
|
||||
|
||||

|
||||

|
||||
|
||||
uvm32 is a minimalist, dependency-free virtual machine sandbox designed for microcontrollers and other resource-constrained devices. Single C file, no dynamic memory allocations, asynchronous design, pure C99.
|
||||
|
||||
On an [STM32L0](https://www.st.com/en/microcontrollers-microprocessors/stm32l0-series.html) (ARM Cortex-M0+) the required footprint is under 4KB flash/1KB RAM.
|
||||
|
||||
uvm32 is a RISC-V emulator, wrapped in a management interface and provided with tools to build efficient code to run in it.
|
||||
|
||||

|
||||
|
||||
## What is it for?
|
||||
|
||||
* As a no-frills alternative to embedded script engines ([Lua](https://www.lua.org/), [Duktape](https://duktape.org/), [MicroPython](https://micropython.org/), etc)
|
||||
|
|
|
|||
|
|
@ -14,13 +14,19 @@ 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}
|
||||
mkdir -p badge
|
||||
curl "https://img.shields.io/badge/Code%20Coverage-${PERC}25-success?style=flat" > badge/badge.svg
|
||||
|
||||
clean:
|
||||
${CLEANCMD} true
|
||||
rm -f coverage.xml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue