diff --git a/.github/scripts/create_verification_dashboard.sh b/.github/scripts/create_verification_dashboard.sh deleted file mode 100755 index 48e9eab521c..00000000000 --- a/.github/scripts/create_verification_dashboard.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -SELF_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))" -. ${SELF_DIR}/common.inc.sh - -create_verification_dashboard(){ - # This function creates a verification dashboard with links to tests: - #

webpage_test_debug

- # Args: - # HTML_OUTPUT_FILE - name of the output file, scripts assumes - # that it will be placed in verifcation dir - check_args_count $# 2 - HTML_OUTPUT_FILE=$1 - VERIFICATION_DASHBOARD_DIR=$2 - echo -e "${COLOR_WHITE}========== create_verification_dashboard args =========${COLOR_CLEAR}" - echo -e "${COLOR_WHITE}HTML_OUTPUT_FILE = ${HTML_OUTPUT_FILE}" - echo -e "${COLOR_WHITE}VERIFICATION_DASHBOARD_DIR = ${VERIFICATION_DASHBOARD_DIR}" - - html_text=" - - - - Verification Dashboard - - -

RISC-V VeeR EL2

-

Verification dashboard

-
-

Test reports

- -
-

Copyright 2023 Antmicro

- - -" - verification_list=`find ./ -maxdepth 1 -type d -name "webpage_*" -printf "%f\n"` - echo ${verification_list} - if [ -z "${verification_list}" ]; then - echo -e "${COLOR_WHITE}Found no verification webpages ${COLOR_YELLOW}WARNING${COLOR_CLEAR}" - mkdir -p ./${VERIFICATION_DASHBOARD_DIR} - echo ${html_text} > ${VERIFICATION_DASHBOARD_DIR}/${HTML_OUTPUT_FILE}.html - echo -e "${COLOR_WHITE}Verification dashboard generation ended with problems ${COLOR_RED}SOFT_ERROR${COLOR_CLEAR}" - echo -e "${COLOR_WHITE}============ create_verification_dashboard ============${COLOR_CLEAR}" - else - mkdir -p ./${VERIFICATION_DASHBOARD_DIR} - html_links=() - for i in ${verification_list} - do - html_page=${i#*webpage_} - html_link="

"${i}"

" - html_links+=("${html_link}") - mv ${i} ./${VERIFICATION_DASHBOARD_DIR} - echo -e "${COLOR_WHITE}Creating link ${COLOR_GREEN}PASS${COLOR_CLEAR}" - done - echo -e "${COLOR_WHITE}Array of links:${COLOR_CLEAR}" - - for link in "${html_links[@]}" - do - echo -e "${COLOR_WHITE}${link}${COLOR_CLEAR}" - done - html_text=${html_text/""/${html_links[*]}} - echo ${html_text} > ${VERIFICATION_DASHBOARD_DIR}/${HTML_OUTPUT_FILE} - # tidy verification/verification_dashboard.html - echo -e "${COLOR_WHITE}Verification dashboard generation ${COLOR_GREEN}SUCCEEDED${COLOR_CLEAR}" - echo -e "${COLOR_WHITE}============ create_verification_dashboard ============${COLOR_CLEAR}" - fi -} - -# Example usage -HTML_OUTPUT_FILE=verification_dashboard.html -VERIFICATION_DASHBOARD_DIR=verification_dashboard -create_verification_dashboard ${HTML_OUTPUT_FILE} ${VERIFICATION_DASHBOARD_DIR} diff --git a/.github/scripts/gen_coverage_reports.sh b/.github/scripts/gen_coverage_reports.sh index 8761d135953..1b902540b9c 100755 --- a/.github/scripts/gen_coverage_reports.sh +++ b/.github/scripts/gen_coverage_reports.sh @@ -42,100 +42,6 @@ generate_coverage_reports(){ done } -#--------------# -# HTML -#--------------# -generate_index_header(){ - # This function creates a basic index html dashboard, which enables navigation - # Args - # OUTPUT_DIR - directory, where index.html will be placed - # GIT_SHA - git revision - check_args_count $# 2 - OUTPUT_DIR=$1 - GIT_SHA=$2 - echo -e "${COLOR_WHITE}========== generate_index_header =============${COLOR_CLEAR}" - echo -e "${COLOR_WHITE}OUTPUT_DIR = ${OUTPUT_DIR}${COLOR_CLEAR}" - echo -e "${COLOR_WHITE}GIT_SHA = ${GIT_SHA}${COLOR_CLEAR}" - - # Function Body - set +x - rm -rf ${OUTPUT_DIR}/index.html - - # Header - echo -n " - - -

RISC-V VeeR EL2

-

Coverage Dashboard

-

Revision: ${GIT_SHA}

- " >>${OUTPUT_DIR}/index.html - - # Summary reports - echo -e "\n
" >>${OUTPUT_DIR}/index.html - echo -e "\n

Summary reports (all tests)

" >>${OUTPUT_DIR}/index.html -} - -generate_index_body(){ - # This function creates a body for the index html - # Args - # OUTPUT_DIR - directory, where index.html will be placed - check_args_count $# 1 - OUTPUT_DIR=$1 - echo -e "${COLOR_WHITE}========== generate_index_body ===============${COLOR_CLEAR}" - echo -e "${COLOR_WHITE}OUTPUT_DIR = ${OUTPUT_DIR}${COLOR_CLEAR}" - - echo "

Coverage:

" >>${OUTPUT_DIR}/index.html - echo "" >>${OUTPUT_DIR}/index.html - - # Per-test reports - echo -e "\n
" >>${OUTPUT_DIR}/index.html - echo -e "\n

Individual test reports

" >>${OUTPUT_DIR}/index.html - - echo "

Coverage:

" >>${OUTPUT_DIR}/index.html - - for COVERAGE in branch toggle all functional; do - echo "

${COVERAGE}

" >>${OUTPUT_DIR}/index.html - echo "" >>${OUTPUT_DIR}/index.html - done - -} - -generate_index_footer(){ - # This function creates a footer for the index html - # Args - # OUTPUT_DIR - directory, where index.html will be placed - check_args_count $# 1 - OUTPUT_DIR=$1 - echo -e "${COLOR_WHITE}========== generate_index_footer =============${COLOR_CLEAR}" - echo -e "${COLOR_WHITE}OUTPUT_DIR = ${OUTPUT_DIR}${COLOR_CLEAR}" - - echo -n " -
-

Copyright 2023 Antmicro

- - - " >>${OUTPUT_DIR}/index.html -} - #--------------# # Script #--------------# @@ -155,9 +61,6 @@ GENHTML_OPTS="--no-function-coverage --no-source" echo -e "${COLOR_WHITE}========== gen_coverage_reports ==============${COLOR_CLEAR}" generate_coverage_reports ${OUTPUT_DIR} "${GENHTML_OPTS}" -generate_index_header ${OUTPUT_DIR} ${GIT_SHA} -generate_index_body ${OUTPUT_DIR} -generate_index_footer ${OUTPUT_DIR} echo -e "${COLOR_WHITE}gen_coverage_reports ${COLOR_GREEN}SUCCEEDED${COLOR_CLEAR}" echo -e "${COLOR_WHITE}========== gen_coverage_reports ==============${COLOR_CLEAR}" diff --git a/.github/scripts/indexgen/.gitignore b/.github/scripts/indexgen/.gitignore new file mode 100644 index 00000000000..7c5f0a3725c --- /dev/null +++ b/.github/scripts/indexgen/.gitignore @@ -0,0 +1,2 @@ +build +source diff --git a/.github/scripts/indexgen/Makefile b/.github/scripts/indexgen/Makefile new file mode 100644 index 00000000000..66e7d908e1a --- /dev/null +++ b/.github/scripts/indexgen/Makefile @@ -0,0 +1,31 @@ +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source.template +GENDIR = source +BUILDDIR ?= build +ROOTDIR ?= work + +all: clean html + +# Sources +SOURCES = $(wildcard $(SOURCEDIR)/*.md) + +# Generate sources +$(GENDIR): + @mkdir -p $@ + +$(GENDIR)/index.md: $(SOURCES) generate.py | $(GENDIR) + @rm -rf $(GENDIR)/* + @python3 generate.py --template "$(SOURCEDIR)" --root "$(ROOTDIR)" --output "$(GENDIR)" + +# Build the final webpage. Pass the 'html' target to sphinx, copy report pages +html: Makefile $(GENDIR)/index.md + @$(SPHINXBUILD) -M $@ "$(GENDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @rsync -avr "$(ROOTDIR)/" "$(BUILDDIR)/html" + @bash update_styles.sh "$(BUILDDIR)" + +clean: + @rm -rf $(BUILDDIR) + @rm -rf $(GENDIR) + +.PHONY: all clean html diff --git a/.github/scripts/indexgen/dashboard-styles/assets/amber.png b/.github/scripts/indexgen/dashboard-styles/assets/amber.png new file mode 100644 index 00000000000..44f1cfced95 Binary files /dev/null and b/.github/scripts/indexgen/dashboard-styles/assets/amber.png differ diff --git a/.github/scripts/indexgen/dashboard-styles/assets/chips-alliance-logo-mono.svg b/.github/scripts/indexgen/dashboard-styles/assets/chips-alliance-logo-mono.svg new file mode 100644 index 00000000000..90fa7a27697 --- /dev/null +++ b/.github/scripts/indexgen/dashboard-styles/assets/chips-alliance-logo-mono.svg @@ -0,0 +1,22 @@ + + + diff --git a/.github/scripts/indexgen/dashboard-styles/assets/emerald.png b/.github/scripts/indexgen/dashboard-styles/assets/emerald.png new file mode 100644 index 00000000000..574728376bc Binary files /dev/null and b/.github/scripts/indexgen/dashboard-styles/assets/emerald.png differ diff --git a/.github/scripts/indexgen/dashboard-styles/assets/ruby.png b/.github/scripts/indexgen/dashboard-styles/assets/ruby.png new file mode 100644 index 00000000000..f7c739e9a87 Binary files /dev/null and b/.github/scripts/indexgen/dashboard-styles/assets/ruby.png differ diff --git a/.github/scripts/indexgen/dashboard-styles/assets/snow.png b/.github/scripts/indexgen/dashboard-styles/assets/snow.png new file mode 100644 index 00000000000..c40f75f1d2f Binary files /dev/null and b/.github/scripts/indexgen/dashboard-styles/assets/snow.png differ diff --git a/.github/scripts/indexgen/dashboard-styles/gcov.css b/.github/scripts/indexgen/dashboard-styles/gcov.css new file mode 100644 index 00000000000..b188df008c7 --- /dev/null +++ b/.github/scripts/indexgen/dashboard-styles/gcov.css @@ -0,0 +1,645 @@ +/* All views: initial background and text color */ +@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap'); + +body +{ + color: #E9EBFA; + background-color: #0E1116; + padding: 0; + margin: 0; + font-family: 'Roboto', sans-serif; + box-sizing: border-box; +} + +/* * { + +} */ + +/* All views: standard link format*/ +a:link +{ + color: #00D0C9; + text-decoration: underline; + font-family: 'Roboto', sans-serif; +} + +/* All views: standard link - visited format */ +a:visited +{ + color: #E9EBFA; + text-decoration: underline; +} + +/* All views: standard link - activated format */ +a:active +{ + color: #00D0C9; + color: #E9EBFA; + text-decoration: underline; +} + +th { + border: 1px solid; +} + +td { + color: #E9EBFA; +} + +body > table:nth-child(1) > tbody > tr:nth-child(3) +{ +height: 300px; +} + +body > center > table td:not(.coverBarOutline){ + border: 1px solid #31363C; +} + +body > center > table > tbody > tr:nth-child(1) { + display: none; +} + +body>table:nth-child(1)>tbody>tr:nth-child(3) { + display: flex; +} + +body > table:nth-child(1) > tbody > tr:nth-child(3) > td { +align-self: center; +padding: 0 95px; +} + +body > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(1) > td.headerValue { + font-size: 35px; +} + +body>table:nth-child(1)>tbody>tr:nth-child(3)>td>table>tbody>tr:nth-child(1)>td.headerItem { + font-weight: 300; + font-size: 35px; +} + +body > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(1) > td.headerValue { + font-size: 35px; +} + +body > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(2) > td.headerItem { + font-size: 22px; + font-weight: 300; +} + + +body > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(2) > td.headerValue { + font-size: 22px; +} + +body > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(3) > td.headerItem { + font-size: 22px; + font-weight: 300; +} + +body > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(3) > td.headerValue { + font-size: 22px; +} + +body > table:nth-child(1) > tbody > tr:nth-child(1) { + position: relative; +} + +body > table:nth-child(1) > tbody > tr:nth-child(1) > td::before { + content: url(../../../_static/white.svg); + position: absolute; + left: 95px; + transform: translateY(-15%); +} + +table { + border-collapse: collapse; + width: 100%; +} + +body > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody { + padding: 0 50px; +} + +body > center > table > tbody tr { + width: 19px; +} + +/* All views: main title format */ +td.title +{ + background-color: #25292E; + color: #DFE1F1; + text-align: center; + padding-bottom: 10px; + font-size: 20px; + font-weight: bold; + padding: 20px 0; +} + +/* All views: header item format */ +td.headerItem +{ + text-align: right; + padding-right: 6px; + + font-weight: bold; + white-space: nowrap; +} + +/* All views: header item value format */ +td.headerValue +{ + text-align: left; + color: #00D0C9; + + font-weight: bold; + white-space: nowrap; +} + +body > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr:nth-child(1) > td:nth-child(5)::after { + content: ' '; + width: 10px; +} + +/* All views: header item coverage table heading */ +td.headerCovTableHead +{ + color: #DFE1F1; + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-size: 14px; + white-space: nowrap; +} + +/* All views: header item coverage table entry */ +td.headerCovTableEntry +{ + text-align: right; + color: #DFE1F1; + text-align: center; + background-color: #31363C; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; +} + +/* All views: header item coverage table entry for high coverage rate */ +td.headerCovTableEntryHi +{ + text-align: right; + color: #000000; + + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #2FC36E; +} + +/* All views: header item coverage table entry for medium coverage rate */ +td.headerCovTableEntryMed +{ + text-align: right; + color: #000000; + + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #EFAC0A; +} + +/* All views: header item coverage table entry for ow coverage rate */ +td.headerCovTableEntryLo +{ + text-align: right; + color: #DFE1F1; + text-align: center; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #F21E08; +} + +/* All views: header legend value for legend entry */ +td.headerValueLeg +{ + text-align: left; + color: #000000; + + font-size: 80%; + white-space: nowrap; + padding-top: 4px; +} + +body>table:nth-child(1)>tbody>tr:nth-child(2)>td { + display: none; +} + +/* All views: color of horizontal ruler */ +td.ruler > img +{ + height: 1px ; + width: 100% ; + background-color: rgba(255, 255, 255, 0.3); + aspect-ratio: 1 / 1; +} + +/* All views: version string format */ +td.versionInfo +{ + text-align: center; + padding-top: 35px; + font-style: italic; +} + +td.versionInfo > a +{ + color: #00D0C9; +} + +/* Directory view/File view (all)/Test case descriptions: + table headline format */ +td.tableHead +{ + text-align: center; + color: #ffffff; + background-color: #0E1116; + + font-size: 16px; + font-weight: bold; + white-space: nowrap; + padding-left: 4px; + padding-right: 4px; +} + +span.tableHeadSort +{ + padding-right: 4px; +} + +td +{ + align-items: center; +} + +center { + padding: 95px; +} + +/* Directory view/File view (all): filename entry format */ +td.coverFile +{ + text-align: left; + padding-left: 10px; + padding-right: 20px; + color: #E9EBFA; + background-color: #0E1116; + font-family: monospace; +} + +/* Directory view/File view (all): bar-graph entry format*/ +td.coverBar +{ + background-color: #0E1116; +} + +/* Directory view/File view (all): bar-graph outline color */ +td.coverBarOutline +{ + background-color: #0E1116; + display: flex; + justify-content: center; +} + +/* Directory view/File view (all): percentage entry for files with + high coverage rate */ +td.coverPerHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #0E1116; + color: #2FC36E; + font-weight: bold; + +} + +/* Directory view/File view (all): line count entry for files with + high coverage rate */ +td.coverNumHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #0E1116; + white-space: nowrap; + +} + +/* Directory view/File view (all): percentage entry for files with + medium coverage rate */ +td.coverPerMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + color: #EFAC0A; + background-color: #0E1116; + font-weight: bold; + +} + +/* Directory view/File view (all): line count entry for files with + medium coverage rate */ +td.coverNumMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #0E1116; + white-space: nowrap; + +} + +/* Directory view/File view (all): percentage entry for files with + low coverage rate */ +td.coverPerLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + color: #F21E08; + background-color: #0E1116; + font-weight: bold; + +} + +/* Directory view/File view (all): line count entry for files with + low coverage rate */ +td.coverNumLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #0E1116; + white-space: nowrap; + +} + +/* File view (all): "show/hide details" link format */ +a.detail:link +{ + color: #B8D0FF; + font-size:80%; +} + +/* File view (all): "show/hide details" link - visited format */ +a.detail:visited +{ + color: #B8D0FF; + font-size:80%; +} + +/* File view (all): "show/hide details" link - activated format */ +a.detail:active +{ + color: #ffffff; + font-size:80%; +} + +/* File view (detail): test name entry */ +td.testName +{ + text-align: right; + padding-right: 10px; + background-color: #dae7fe; + +} + +/* File view (detail): test percentage entry */ +td.testPer +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + +} + +/* File view (detail): test lines count entry */ +td.testNum +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + +} + +/* Test case descriptions: test name format*/ +dt +{ + + font-weight: bold; +} + +/* Test case descriptions: description table body */ +td.testDescription +{ + padding-top: 10px; + padding-left: 30px; + padding-bottom: 10px; + padding-right: 30px; + background-color: #dae7fe; +} + +/* Source code view: function entry */ +td.coverFn +{ + text-align: left; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + background-color: #dae7fe; + font-family: monospace; +} + +/* Source code view: function entry zero count*/ +td.coverFnLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + font-weight: bold; + +} + +/* Source code view: function entry nonzero count*/ +td.coverFnHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-weight: bold; + +} + +/* Source code view: source code format */ +pre.source +{ + font-family: monospace; + white-space: pre; + margin-top: 2px; +} + +/* Source code view: line number format */ +span.lineNum +{ + background-color: #efe383; +} + +/* Source code view: format for lines which were executed */ +td.lineCov, +span.lineCov +{ + background-color: #cad7fe; +} + +/* Source code view: format for Cov legend */ +span.coverLegendCov +{ + padding-left: 10px; + padding-right: 10px; + padding-bottom: 2px; + background-color: #cad7fe; +} + +/* Source code view: format for lines which were not executed */ +td.lineNoCov, +span.lineNoCov +{ + background-color: #ff6230; +} + +/* Source code view: format for NoCov legend */ +span.coverLegendNoCov +{ + padding-left: 10px; + padding-right: 10px; + padding-bottom: 2px; + background-color: #ff6230; +} + +/* Source code view (function table): standard link - visited format */ +td.lineNoCov > a:visited, +td.lineCov > a:visited +{ + color: #000000; + text-decoration: underline; +} + +/* Source code view: format for lines which were executed only in a + previous version */ +span.lineDiffCov +{ + background-color: #b5f7af; +} + +/* Source code view: format for branches which were executed + * and taken */ +span.branchCov +{ + background-color: #cad7fe; +} + +/* Source code view: format for branches which were executed + * but not taken */ +span.branchNoCov +{ + background-color: #ff6230; +} + +/* Source code view: format for branches which were not executed */ +span.branchNoExec +{ + background-color: #ff6230; +} + +/* Source code view: format for the source code heading line */ +pre.sourceHeading +{ + white-space: pre; + font-family: monospace; + font-weight: bold; + margin: 0px; +} + +/* All views: header legend value for low rate */ +td.headerValueLegL +{ + + text-align: center; + white-space: nowrap; + padding-left: 4px; + padding-right: 2px; + background-color: #ff0000; + font-size: 80%; +} + +/* All views: header legend value for med rate */ +td.headerValueLegM +{ + + text-align: center; + white-space: nowrap; + padding-left: 2px; + padding-right: 2px; + background-color: #ffea20; + font-size: 80%; +} + +/* All views: header legend value for hi rate */ +td.headerValueLegH +{ + + text-align: center; + white-space: nowrap; + padding-left: 2px; + padding-right: 4px; + background-color: #a7fc9d; + font-size: 80%; +} + +/* All views except source code view: legend format for low coverage */ +span.coverLegendCovLo +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #ff0000; +} + +/* All views except source code view: legend format for med coverage */ +span.coverLegendCovMed +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #ffea20; +} + +/* All views except source code view: legend format for hi coverage */ +span.coverLegendCovHi +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #a7fc9d; +} \ No newline at end of file diff --git a/.github/scripts/indexgen/dashboard-styles/main.css b/.github/scripts/indexgen/dashboard-styles/main.css new file mode 100644 index 00000000000..cd211b1927d --- /dev/null +++ b/.github/scripts/indexgen/dashboard-styles/main.css @@ -0,0 +1,20 @@ +[data-md-color-scheme="slate"] { + --md-hue: 218; + --md-default-bg-color: hsla(var(--md-hue), 22%, 7%, 1); +} + +[data-md-color-primary="teal"] { + --md-primary-fg-color: #25292e; +} + +[data-md-color-scheme="slate"][data-md-color-primary="teal"] { + --md-typeset-a-color: #00d0c9; +} + +.md-social { + display: none; +} + +.md-header__option { + display: none; +} \ No newline at end of file diff --git a/.github/scripts/indexgen/generate.py b/.github/scripts/indexgen/generate.py new file mode 100755 index 00000000000..1b914757c82 --- /dev/null +++ b/.github/scripts/indexgen/generate.py @@ -0,0 +1,210 @@ +#!/usr/bin/env python3 +import argparse +import os +import shutil + +import jinja2 + +# ============================================================================== + + +def render_template(src, dst, **kwargs): + """ + Renders a jinja2 template file to another file + """ + with open(src, "r") as fp: + tpl = jinja2.Template(fp.read()) + with open(dst, "w") as fp: + fp.write(tpl.render(**kwargs)) + +# ============================================================================== + + +def make_coverage_report_index(branch, root, output, templates): + """ + Prepares coverage report index page + """ + + keys = ["all", "branch", "toggle", "functional"] + path = os.path.join(root, "coverage_dashboard") + + # Collect summary reports + summary = {k: None for k in keys} + for key in keys: + file = key + fname = os.path.join(path, file) + if os.path.isdir(fname): + summary[key] = file + + # Collect individual test reports + individual = {k: dict() for k in keys} + for key in keys: + pfx = key + "_" + + if not os.path.isdir(path): + continue + + for file in sorted(os.listdir(path)): + fname = os.path.join(path, file) + if not os.path.isdir(fname): + continue + if not file.startswith(pfx): + continue + + # Extract test name + test_name = file[len(pfx):] + + # Append the report + individual[key][test_name] = file + + # Render the template + params = { + "ref": branch + "_coverage_dashboard", + "summary": summary, + "individual": individual, + } + + os.makedirs(output, exist_ok=True) + render_template( + os.path.join(templates, "coverage_dashboard.md"), + os.path.join(output, "coverage_dashboard.md"), + **params + ) + + +def make_verification_report_index(branch, root, output, templates): + """ + Prepares verification tests report index page + """ + + path = os.path.join(root, "verification_dashboard") + + # Collect tests + tests = set() + + if os.path.isdir(path): + for file in sorted(os.listdir(path)): + if not file.startswith("webpage_"): + continue + + test_name = file.replace("webpage_", "") + tests.add(test_name) + + # Render the template + params = { + "ref": branch + "_verification_dashboard", + "tests": tests, + } + + os.makedirs(output, exist_ok=True) + render_template( + os.path.join(templates, "verification_dashboard.md"), + os.path.join(output, "verification_dashboard.md"), + **params + ) + + +def make_dev_index(branches, output, templates): + """ + Prepares the branch/pr index page + """ + + params = { + "branches": branches, + } + + render_template( + os.path.join(templates, "dev.md"), + os.path.join(output, "dev.md"), + **params + ) + +# ============================================================================== + + +def main(): + + # Parse args + parser = argparse.ArgumentParser() + parser.add_argument( + "--template", + type=str, + required=True, + help="Templates path", + ) + parser.add_argument( + "--root", + type=str, + default=None, + help="Existing webpage root path", + ) + parser.add_argument( + "--output", + type=str, + required=True, + help="Output path", + ) + + args = parser.parse_args() + + # Check + if os.path.abspath(args.root) == os.path.abspath(args.output): + print("Error: Existing webpage root and output paths mustn't be the same") + exit(-1) + + # Reports for the main branch + make_coverage_report_index( + "main", + os.path.join(args.root, "main"), + os.path.join(args.output, "main"), + args.template + ) + + make_verification_report_index( + "main", + os.path.join(args.root, "main"), + os.path.join(args.output, "main"), + args.template + ) + + # Reports for development branches / pull requests + branches = [] + path = os.path.join(args.root, "dev") + for file in os.listdir(path): + if not os.path.isdir(os.path.join(path, file)): + continue + + branches.append(file) + + make_coverage_report_index( + file, + os.path.join(args.root, "dev", file), + os.path.join(args.output, "dev", file), + args.template + ) + + make_verification_report_index( + file, + os.path.join(args.root, "dev", file), + os.path.join(args.output, "dev", file), + args.template + ) + + # Prepare the branch/pr index page + make_dev_index(branches, args.output, args.template) + + # Copy other files/pages + files = [ + "conf.py", + "main.md", + "index.md", + ] + for file in files: + shutil.copy( + os.path.join(args.template, file), + os.path.join(args.output, file), + ) + + +if __name__ == "__main__": + main() diff --git a/.github/scripts/indexgen/index_redirect/index.html b/.github/scripts/indexgen/index_redirect/index.html new file mode 100644 index 00000000000..cc090ed6608 --- /dev/null +++ b/.github/scripts/indexgen/index_redirect/index.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.github/scripts/indexgen/requirements.txt b/.github/scripts/indexgen/requirements.txt new file mode 100644 index 00000000000..3d2064a3e7e --- /dev/null +++ b/.github/scripts/indexgen/requirements.txt @@ -0,0 +1,9 @@ +myst-parser +sphinx +sphinx_tabs +sphinxcontrib-mermaid + +https://github.com/antmicro/sphinx-immaterial/releases/download/tip/sphinx_immaterial-0.0.post1.tip-py3-none-any.whl +https://github.com/antmicro/antmicro-sphinx-utils/archive/main.zip + +jinja2 diff --git a/.github/scripts/indexgen/source.template/conf.py b/.github/scripts/indexgen/source.template/conf.py new file mode 100644 index 00000000000..dcbcf9dd3bb --- /dev/null +++ b/.github/scripts/indexgen/source.template/conf.py @@ -0,0 +1,92 @@ +# -*- coding: utf-8 -*- +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. +# +# Updated documentation of the configuration options is available at +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +from datetime import datetime + +from antmicro_sphinx_utils.defaults import ( + numfig_format, + extensions as default_extensions, + myst_enable_extensions as default_myst_enable_extensions, + antmicro_html, +) + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# General information about the project. +project = u'RISC-V VeeR-EL2 Core' +basic_filename = u'veer-test-reports' +authors = u'CHIPS Alliance' +copyright = f'{authors}, {datetime.now().year}' + +# The short X.Y version. +version = '' +# The full version, including alpha/beta/rc tags. +release = '' + +# This is temporary before the clash between myst-parser and immaterial is fixed +sphinx_immaterial_override_builtin_admonitions = False + +numfig = True + +# If you need to add extensions just add to those lists +extensions = default_extensions +myst_enable_extensions = default_myst_enable_extensions + +myst_substitutions = { + "project": project +} + +myst_url_schemes = { + "http": None, + "https": None, + "external": "{{path}}", +} + +today_fmt = '%Y-%m-%d' + +todo_include_todos=False + +# -- Options for HTML output --------------------------------------------------- + +html_theme = 'sphinx_immaterial' + +html_last_updated_fmt = today_fmt + +html_show_sphinx = False + +( + html_logo, + html_theme_options, + html_context +) = antmicro_html() + + +html_theme_options["palette"][0].update({ + "scheme": "slate", + "primary": "teal", + "accent": "white", +}) + +# # Disable toggle theme button +# html_theme_options = { +# "palette": [] +# } + +html_title = project + +def setup(app): + app.add_css_file('main.css') diff --git a/.github/scripts/indexgen/source.template/coverage_dashboard.md b/.github/scripts/indexgen/source.template/coverage_dashboard.md new file mode 100644 index 00000000000..e7cc8c5f3cc --- /dev/null +++ b/.github/scripts/indexgen/source.template/coverage_dashboard.md @@ -0,0 +1,25 @@ +({{ ref }})= +# Coverage dashboard + +## Summary reports (all tests) + +{%- for coverage in summary %} +{%- if summary[coverage] %} + * [{{ coverage }} coverage](external:coverage_dashboard/{{ summary[coverage] }}/index.html) +{%- else %} + * {{ coverage }} coverage (no data) +{%- endif %} +{%- endfor %} + +## Individual test reports + +{%- for coverage in individual %} +### {{ coverage }} coverage +{%- if individual[coverage] %} +{%- for test in individual[coverage] %} + * [{{ test }}](external:coverage_dashboard/{{ individual[coverage][test] }}/index.html) +{%- endfor %} +{%- else %} +no data +{%- endif %} +{%- endfor %} diff --git a/.github/scripts/indexgen/source.template/dev.md b/.github/scripts/indexgen/source.template/dev.md new file mode 100644 index 00000000000..836fd032fc6 --- /dev/null +++ b/.github/scripts/indexgen/source.template/dev.md @@ -0,0 +1,7 @@ +# Active pull requests + +{%- for branch in branches %} + * {{ branch }} + * [Coverage]({{ branch }}_coverage_dashboard) + * [Verification tests]({{ branch }}_verification_dashboard) +{%- endfor %} diff --git a/.github/scripts/indexgen/source.template/index.md b/.github/scripts/indexgen/source.template/index.md new file mode 100644 index 00000000000..800fc84abad --- /dev/null +++ b/.github/scripts/indexgen/source.template/index.md @@ -0,0 +1,8 @@ +# {{ project }} + +```{toctree} +:maxdepth: 2 + +main +dev +``` diff --git a/.github/scripts/indexgen/source.template/main.md b/.github/scripts/indexgen/source.template/main.md new file mode 100644 index 00000000000..2c034f335e2 --- /dev/null +++ b/.github/scripts/indexgen/source.template/main.md @@ -0,0 +1,4 @@ +# Main branch + + * [Coverage](main_coverage_dashboard) + * [Verification tests](main_verification_dashboard) diff --git a/.github/scripts/indexgen/source.template/verification_dashboard.md b/.github/scripts/indexgen/source.template/verification_dashboard.md new file mode 100644 index 00000000000..117962205b7 --- /dev/null +++ b/.github/scripts/indexgen/source.template/verification_dashboard.md @@ -0,0 +1,8 @@ +({{ ref }})= +# Verification tests dashboard + +## Test reports + +{%- for test in tests %} + * [{{ test }}](external:verification_dashboard/webpage_{{ test }}/{{ test }}.html) +{%- endfor %} diff --git a/.github/scripts/indexgen/update_styles.sh b/.github/scripts/indexgen/update_styles.sh new file mode 100644 index 00000000000..83aa0ba19bc --- /dev/null +++ b/.github/scripts/indexgen/update_styles.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +SELF_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))" +. ${SELF_DIR}/../common.inc.sh + +update_styles(){ + # Update styles for sphinx theme and LCOV reports + # Args: + # BUILDDIR - path to where the webpage is made + BUILD_DIR=$1 + echo -e "${COLOR_WHITE}========== Update styles =========${COLOR_CLEAR}" + echo -e "${COLOR_WHITE} BUILD_DIR = ${BUILD_DIR}${COLOR_CLEAR}" + + # Replace styles for sphinx build + cp dashboard-styles/main.css ${BUILD_DIR}/html/_static/ + + # Add CHIPs logo + cp dashboard-styles/assets/chips-alliance-logo-mono.svg ${BUILD_DIR}/html/_static/white.svg + + # Replace undesired CSS and progress bar sprites with desired style for LCOV reports + copy_files(){ + check_args_count $# 2 + SOURCE=$1 + SEARCH=$2 + FILES=`find ${BUILD_DIR}/ -name ${SEARCH}` + + for FILE in ${FILES}; do + echo "Copy ${SOURCE} to ${FILE}" + cp $SOURCE $FILE + done + } + + CHIPS_GCOV_CSS=dashboard-styles/gcov.css + AMBER=dashboard-styles/assets/amber.png + RUBY=dashboard-styles/assets/ruby.png + SNOW=dashboard-styles/assets/snow.png + EMERALD=dashboard-styles/assets/emerald.png + + for ASSET in $CHIPS_GCOV_CSS $AMBER $RUBY $SNOW $EMERALD; do + echo -e "${COLOR_WHITE}========== $ASSET =========${COLOR_CLEAR}" + copy_files $ASSET $(basename "$ASSET") + done + echo -e "${COLOR_WHITE}Update styles ${COLOR_GREEN}SUCCEEDED${COLOR_CLEAR}" + echo -e "${COLOR_WHITE}==========================${COLOR_CLEAR}" +} + +# Example usage +# BUILD_DIR=./build +# update_styles.sh $BUILD_DIR + +check_args_count $# 1 +update_styles "$@" \ No newline at end of file diff --git a/.github/scripts/pytest/assets/arrow.svg b/.github/scripts/pytest/assets/arrow.svg new file mode 100644 index 00000000000..f55da9bb1ca --- /dev/null +++ b/.github/scripts/pytest/assets/arrow.svg @@ -0,0 +1,4 @@ + + + + diff --git a/.github/scripts/pytest/assets/chips-alliance-logo-mono.svg b/.github/scripts/pytest/assets/chips-alliance-logo-mono.svg new file mode 100644 index 00000000000..da73ecf4fdd --- /dev/null +++ b/.github/scripts/pytest/assets/chips-alliance-logo-mono.svg @@ -0,0 +1,23 @@ + + + + diff --git a/.github/scripts/pytest/bar.html b/.github/scripts/pytest/bar.html new file mode 100644 index 00000000000..19cb07d5967 --- /dev/null +++ b/.github/scripts/pytest/bar.html @@ -0,0 +1,10 @@ + +
+ + back + + + chips-alliance-logo + + test_pyuvm_branch.html +
diff --git a/.github/scripts/pytest/css/styles.css b/.github/scripts/pytest/css/styles.css new file mode 100644 index 00000000000..efbc991a8c0 --- /dev/null +++ b/.github/scripts/pytest/css/styles.css @@ -0,0 +1,103 @@ +@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"); + +body { + background-color: #0e1116; + font-family: "Roboto", sans-serif; + margin: 0; + padding: 0; +} + +body > *:not(:nth-child(3)) { + max-width: 1520px; + margin-left: auto; + margin-right: auto; +} + +body > input:first-of-type { + margin-left: max(0px, (100% - 1520px) / 2); +} + +h1, +h2, +span, +p { + color: #dfe1f1; + font-size: 16px; +} + +h1, +h2 { + font-size: 24px; + font-weight: 500; + margin-top: 75px; +} + +a { + color: #00d0c9; +} + +.passed { + color: #2fc36e; + font-size: 14px; + margin-left: 5px !important; +} + +.xfailed, +.skipped { + color: #efac0a; + font-size: 14px; + margin-left: 5px !important; +} + +.failed, +.error, +.xpassed { + color: #f21e08; + font-size: 14px; + margin-left: 5px !important; +} + +.col-name, +.col-duration { + color: #dfe1f1; + font-size: 14px; +} + +.sortable { + color: #dfe1f1; + font-size: 16px; +} + +.log { + background-color: #31363c; + color: #dfe1f1; + overflow: auto; +} + +.bar { + display: inline-flex; + width: 100%; + padding: 20px; + align-items: center; + background-color: #25292e; + box-sizing: border-box; +} + +.bar > .arrow { + width: 30px; + height: 30px; + cursor: pointer; +} + +.bar > .chip-alliance-link { + position: absolute; + left: max(150px, (100% - 1520px) / 2); +} + +.bar > .title { + position: absolute; + left: 50%; + transform: translateX(-50%); + font-size: 20px; + font-weight: 700; +} diff --git a/.github/scripts/pytest/script/script.js b/.github/scripts/pytest/script/script.js new file mode 100644 index 00000000000..6a908306050 --- /dev/null +++ b/.github/scripts/pytest/script/script.js @@ -0,0 +1,3 @@ +function previousPage() { + window.history.back() +} diff --git a/.github/scripts/pytest/style_pytest_report.sh b/.github/scripts/pytest/style_pytest_report.sh new file mode 100644 index 00000000000..5cf68457990 --- /dev/null +++ b/.github/scripts/pytest/style_pytest_report.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +SELF_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))" +. ${SELF_DIR}/../common.inc.sh + +style_pytest_report(){ + check_args_count $# 3 + SRC_DIR=$1 + DST_DIR=$2 + HTML_FILE=$3 + echo -e "${COLOR_WHITE}========== style_pytest_report =========${COLOR_CLEAR}" + echo -e "${COLOR_WHITE} SRC_DIR = ${SRC_DIR}${COLOR_CLEAR}" + echo -e "${COLOR_WHITE} DST_DIR = ${DST_DIR}${COLOR_CLEAR}" + echo -e "${COLOR_WHITE} HTML_FILE = ${HTML_FILE}${COLOR_CLEAR}" + + # Copy assets + + cp ${SRC_DIR}/assets/* ${DST_DIR}/assets/ + + # Add bar above h1.title + + SEARCH="

" + REPLACE=`cat ${SRC_DIR}/bar.html | tr '\n' ' '` + REPLACE="$REPLACE $SEARCH" + filename="${DST_DIR}/${HTML_FILE}" + + sed -i "s@$SEARCH@$REPLACE@" $filename + + # Copy JS script to build dir + + cp -r ${SRC_DIR}/script ${DST_DIR} + + echo -e "${COLOR_WHITE}Style pytest report ${COLOR_GREEN}SUCCEEDED${COLOR_CLEAR}" + echo -e "${COLOR_WHITE}========== style_pytest_report =========${COLOR_CLEAR}" +} + +check_args_count $# 3 +style_pytest_report "$@" diff --git a/.github/scripts/update_webpage.sh b/.github/scripts/update_webpage.sh index 6bdfce0209f..ad467ac3fbb 100755 --- a/.github/scripts/update_webpage.sh +++ b/.github/scripts/update_webpage.sh @@ -27,66 +27,6 @@ replace_dir(){ fi } -generate_index(){ - # Generates the top-level index webpage - # Args: - # ROOT - webpage root path - check_args_count $# 1 - ROOT=$1 - echo -e "${COLOR_WHITE}=========== generate_index args ===========${COLOR_CLEAR}" - echo -e "${COLOR_WHITE}ROOT = ${ROOT}" - - INDEX=${ROOT}/index.html - rm -rf ${INDEX} - - # Header - echo -n " - - - -

RISC-V VeeR EL2

-

Dashboard

-
-

Main branch

- -
-

Feature branches / pull requests

- " >>${INDEX} - - # List subpages - pushd ${ROOT} - if ! SUBDIRS=`find dev/ -maxdepth 1 -type d ! -name "." ! -name ".." -printf "%P\n" | sort`; then - echo -e "Directory dev/ not found" - fi - popd - - # Body - for SUBDIR in ${SUBDIRS}; do - echo -e "${COLOR_WHITE}Found subpage ${SUBDIR}${COLOR_CLEAR}" - echo -n " -

${SUBDIR}

- - " >>${INDEX} - done - - # Footer - echo -n " -
-

Copyright 2023 Antmicro

- - - - " >>${INDEX} - - echo -e "${COLOR_WHITE}Index generation ${COLOR_GREEN}SUCCEEDED${COLOR_CLEAR}" -} - update_webpage(){ # This function updates the public part of the gh-pages, which contain # coverage and verification reports. Different destination directory is @@ -100,7 +40,7 @@ update_webpage(){ LOC_GITHUB_EVENT_NAME=$2 PR_NUMBER=$3 echo -e "${COLOR_WHITE}========== update_webpage args =========${COLOR_CLEAR}" - echo -e "${COLOR_WHITE}LOC_GITHUB_REF_NAME = ${LOC_GITHUB_REF_NAME}" + echo -e "${COLOR_WHITE}LOC_GITHUB_REF_NAME = ${LOC_GITHUB_REF_NAME}" echo -e "${COLOR_WHITE}LOC_GITHUB_EVENT_NAME = ${LOC_GITHUB_EVENT_NAME}" echo -e "${COLOR_WHITE}PR_NUMBER = ${PR_NUMBER}" @@ -120,15 +60,22 @@ update_webpage(){ echo -e "${COLOR_WHITE}Unknown deployment type ${COLOR_RED}FAIL${COLOR_CLEAR}" exit -1 fi - PUBLIC_DIR=./public + PUBLIC_DIR=./public.old replace_dir ./coverage_dashboard ${PUBLIC_DIR}/${DIR}/coverage_dashboard replace_dir ./verification_dashboard ${PUBLIC_DIR}/${DIR}/verification_dashboard - generate_index ${PUBLIC_DIR} + pushd .github/scripts/indexgen + python -m venv venv + source venv/bin/activate + pip install -r requirements.txt + popd + + make -C .github/scripts/indexgen all ROOTDIR=`realpath ./public.old` BUILDDIR=`realpath ./public.new` + echo -e "${COLOR_WHITE}Makefile exit status:$?${COLOR_CLEAR}" echo -e "${COLOR_WHITE}================= tree =================${COLOR_CLEAR}" - tree ./public/ + tree -d -L 3 ./public.new/ echo -e "${COLOR_WHITE}Webpage update ${COLOR_GREEN}SUCCEEDED${COLOR_CLEAR}" echo -e "${COLOR_WHITE}============ update_webpage ============${COLOR_CLEAR}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e4649549d1..58a98208d89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,15 +41,10 @@ jobs: needs: [Test-Regression, Test-Verification, Test-RISCV-DV, Test-RISCOF] uses: ./.github/workflows/report-coverage.yml - Report-Pytest: - name: Report-Pytest - needs: [Test-Verification] - uses: ./.github/workflows/report-pytest.yml - Publish-to-GH-Pages: permissions: actions: write contents: write name: Publish-to-GH-Pages - needs: [Report-Coverage, Report-Pytest] + needs: [Report-Coverage, Test-Verification] uses: ./.github/workflows/publish-webpage.yml diff --git a/.github/workflows/gh-pages-pr-deploy.yml b/.github/workflows/gh-pages-pr-deploy.yml index 6c5cd924f61..6c1eb9ff59e 100644 --- a/.github/workflows/gh-pages-pr-deploy.yml +++ b/.github/workflows/gh-pages-pr-deploy.yml @@ -6,9 +6,6 @@ on: types: - completed -env: - ROOT_DIR: './' - jobs: deploy: name: PR Deploy @@ -25,7 +22,7 @@ jobs: uses: dawidd6/action-download-artifact@v2 with: name: pr_deployment - path: ${{ env.ROOT_DIR }} + path: ./public.new run_id: ${{ github.event.workflow_run.id }} - name: Deploy @@ -33,4 +30,4 @@ jobs: if: ${{ github.ref == 'refs/heads/main' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ${{ env.ROOT_DIR }} + publish_dir: ./public.new diff --git a/.github/workflows/publish-webpage.yml b/.github/workflows/publish-webpage.yml index 59ceddd8130..8e276aad238 100644 --- a/.github/workflows/publish-webpage.yml +++ b/.github/workflows/publish-webpage.yml @@ -3,9 +3,6 @@ name: GH-Pages Build and Main Deploy on: workflow_call: -env: - ROOT_DIR: './public' - jobs: build: name: Build and Main Deploy @@ -18,11 +15,8 @@ jobs: - name: Setup repository uses: actions/checkout@v3 - - name: Checkout gh-pages - uses: actions/checkout@v3 - with: - ref: gh-pages - path: ${{ env.ROOT_DIR }} + - name: Setup python + uses: actions/setup-python@v4 - name: Print metadata run: | @@ -41,6 +35,18 @@ jobs: name: verification_dashboard path: ./verification_dashboard + - name: Checkout gh-pages + uses: actions/checkout@v3 + with: + ref: gh-pages + path: ./public.checkout + + - name: Preserve only valid items + run: | + mkdir -p ./public.old + cp -r ./public.checkout/doctrees ./public.old/ | true + cp -r ./public.checkout/html ./public.old/ | true + - name: Update webpage if: github.event_name != 'pull_request' run: | @@ -51,19 +57,23 @@ jobs: run: | .github/scripts/update_webpage.sh ${{ github.ref_name }} ${{ github.event_name }} ${{ github.event.number }} + - name: Add redirect index page + run: | + cp .github/scripts/indexgen/index_redirect/index.html ./public.new/ + - name: Deploy uses: peaceiris/actions-gh-pages@v3 if: ${{ github.ref == 'refs/heads/main' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ${{ env.ROOT_DIR }} + publish_dir: ./public.new - name: Upload artifacts uses: actions/upload-artifact@v3 if: github.event_name == 'pull_request' with: name: pr_deployment - path: ${{ env.ROOT_DIR }} + path: ./public.new - name: Save PR number if: github.event_name == 'pull_request' @@ -82,4 +92,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: webpage - path: ${{ env.ROOT_DIR }} + path: ./public.new diff --git a/.github/workflows/report-pytest.yml b/.github/workflows/report-pytest.yml deleted file mode 100644 index 8f6fc30cb95..00000000000 --- a/.github/workflows/report-pytest.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Report Pytest - -on: - workflow_call: - -jobs: - report-html: - name: Report html - runs-on: ubuntu-latest - - steps: - - name: Setup repository - uses: actions/checkout@v3 - - - name: Download html reports - uses: actions/download-artifact@v3 - with: - name: verification_tests_html_data - path: ./ - - - name: Create html dashboard - run: | - .github/scripts/create_verification_dashboard.sh - - - name: Upload artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: verification_dashboard - path: | - ./verification_dashboard diff --git a/.github/workflows/test-verification.yml b/.github/workflows/test-verification.yml index 100ff7ca7c5..60a096e2245 100644 --- a/.github/workflows/test-verification.yml +++ b/.github/workflows/test-verification.yml @@ -92,9 +92,12 @@ jobs: run: | pip3 install meson pip3 install -r $RV_ROOT/verification/requirements.txt - + PYTEST_STYLE_SRC_DIR=${{ github.workspace }}/.github/scripts/pytest/ + PYTEST_CSS=${PYTEST_STYLE_SRC_DIR}/css/styles.css + HTML_FILE=${{ matrix.test }}_${{ matrix.COVERAGE }}.html pushd ${TEST_PATH} - python -m pytest ${{ matrix.test }}.py -sv --coverage=${{ matrix.COVERAGE }} --html=${{ matrix.test }}_${{ matrix.COVERAGE }}.html --md=$GITHUB_STEP_SUMMARY + python -m pytest ${{ matrix.test }}.py -sv --coverage=${{ matrix.COVERAGE }} --html=$HTML_FILE --md=$GITHUB_STEP_SUMMARY --css=$PYTEST_CSS + bash ${PYTEST_STYLE_SRC_DIR}/style_pytest_report.sh ${PYTEST_STYLE_SRC_DIR} ${TEST_PATH} ${HTML_FILE} popd - name: Prepare pytest-html data @@ -104,6 +107,8 @@ jobs: mkdir -p $WEBPAGE_DIR mv ${TEST_PATH}/${{ matrix.test }}_${{ matrix.COVERAGE }}.html $WEBPAGE_DIR mv ${TEST_PATH}/assets $WEBPAGE_DIR + JS_SCRIPT_DIR=${{ github.workspace }}/.github/scripts/pytest/script + mv $JS_SCRIPT_DIR $WEBPAGE_DIR popd - name: Prepare coverage data @@ -119,7 +124,7 @@ jobs: if: always() uses: actions/upload-artifact@v3 with: - name: verification_tests_html_data + name: verification_dashboard path: | webpage_*