Skip to content

Commit 69b63c3

Browse files
committed
Refactor CRD and CTP Generation
- Check CRD in CI regression - Build and release CRD when it changes (similar to what is done already for the CTP) - Generate CTP adoc files in build directory instead of src directory - Share common adoc files between CRD and CTP - Update CTP Makefile to use updated flow from upstream ISA manual
1 parent fe6b75e commit 69b63c3

File tree

13 files changed

+283
-222
lines changed

13 files changed

+283
-222
lines changed

.github/workflows/ctp-build.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

.github/workflows/regress.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -308,27 +308,29 @@ jobs:
308308
- name: Pull Container
309309
run: docker pull riscvintl/riscv-docs-base-container-image:latest
310310

311-
- name: Build
311+
- name: Build CTP
312312
run: cd docs/ctp && make -j2
313313

314-
- name: Upload PDF
315-
uses: actions/upload-artifact@v6
316-
with:
317-
name: ctp.pdf
318-
path: docs/ctp/build/ctp.pdf
314+
crd-build:
315+
name: Build CRD
316+
runs-on: ubuntu-latest
317+
steps:
318+
- uses: actions/checkout@v6
319319

320-
- name: Upload HTML
321-
uses: actions/upload-artifact@v6
322-
with:
323-
name: ctp.html
324-
path: docs/ctp/build/ctp.html
320+
- run: git submodule update --init docs/docs-resources
321+
322+
- name: Pull Container
323+
run: docker pull riscvintl/riscv-docs-base-container-image:latest
324+
325+
- name: Build CRD
326+
run: cd docs/crd && make -j2
325327

326328
# This is here so that the "Status checks that are required" Github
327329
# option doesn't need to list all of the matrix jobs (it doesn't seem
328330
# to work if you just specify the job ID of the matrix itself).
329331
ci_pass:
330332
runs-on: ubuntu-latest
331-
needs: [lint, regress, spike, qemu, vector-testgen, ctp-build]
333+
needs: [lint, regress, spike, qemu, vector-testgen, ctp-build, crd-build]
332334
if: "${{ always() }}"
333335
steps:
334336
- name: exit failure

.github/workflows/release-docs.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: Build & Deploy Certification Documents
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- act4
8+
paths:
9+
- "docs/**"
10+
- "generators/ctp/**"
11+
- "testplans/**"
12+
- ".github/workflows/docs.yml"
13+
14+
permissions:
15+
contents: write
16+
actions: read
17+
pages: write
18+
id-token: write
19+
20+
jobs:
21+
build-ctp:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v6
25+
26+
- name: Install the latest version of uv
27+
uses: astral-sh/setup-uv@v7
28+
29+
- run: git submodule update --init docs/docs-resources external/riscv-unified-db
30+
31+
- name: Build CTP
32+
run: cd docs/ctp && make -j2
33+
34+
- name: Upload CTP PDF
35+
uses: actions/upload-artifact@v6
36+
with:
37+
name: ctp.pdf
38+
path: docs/ctp/build/ctp.pdf
39+
40+
- name: Upload CTP HTML
41+
uses: actions/upload-artifact@v6
42+
with:
43+
name: ctp.html
44+
path: docs/ctp/build/ctp.html
45+
46+
build-crd:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v6
50+
51+
- run: git submodule update --init docs/docs-resources
52+
53+
- name: Build CRD
54+
run: cd docs/crd && make -j2
55+
56+
- name: Upload CRD PDF
57+
uses: actions/upload-artifact@v6
58+
with:
59+
name: rvi20_crd.pdf
60+
path: docs/crd/build/rvi20_crd.pdf
61+
62+
- name: Upload CRD HTML
63+
uses: actions/upload-artifact@v6
64+
with:
65+
name: rvi20_crd.html
66+
path: docs/crd/build/rvi20_crd.html
67+
68+
release:
69+
needs: [build-ctp, build-crd]
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Download CTP PDF
73+
uses: actions/download-artifact@v7
74+
with:
75+
name: ctp.pdf
76+
path: ./
77+
78+
- name: Download CTP HTML
79+
uses: actions/download-artifact@v7
80+
with:
81+
name: ctp.html
82+
path: ./
83+
84+
- name: Download CRD PDF
85+
uses: actions/download-artifact@v7
86+
with:
87+
name: rvi20_crd.pdf
88+
path: ./
89+
90+
- name: Download CRD HTML
91+
uses: actions/download-artifact@v7
92+
with:
93+
name: rvi20_crd.html
94+
path: ./
95+
96+
- name: Get current date
97+
run: |
98+
echo "CURRENT_DATE=$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_ENV
99+
echo "SHORT_SHA=$(echo ${GITHUB_SHA::7})" >> $GITHUB_ENV
100+
101+
- name: Create Release
102+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b
103+
with:
104+
draft: false
105+
prerelease: ${{ github.event_name != 'workflow_dispatch' }}
106+
make_latest: true
107+
tag_name: cert-docs-${{ env.CURRENT_DATE }}-${{ env.SHORT_SHA }}
108+
name: "Certification Documents ${{ env.CURRENT_DATE }}: ${{ env.SHORT_SHA }}"
109+
body: "Automated release of the certification documents (CTP & CRD) built on ${{ env.CURRENT_DATE }} from commit ${{ env.SHORT_SHA }}."
110+
files: |
111+
ctp.pdf
112+
ctp.html
113+
rvi20_crd.pdf
114+
rvi20_crd.html
115+
116+
deploy-pages:
117+
needs: [build-ctp, build-crd]
118+
runs-on: ubuntu-latest
119+
environment:
120+
name: github-pages
121+
url: ${{ steps.deployment.outputs.page_url }}
122+
steps:
123+
- name: Download CTP HTML
124+
uses: actions/download-artifact@v7
125+
with:
126+
name: ctp.html
127+
path: ./github-pages/ctp
128+
129+
- name: Download CRD HTML
130+
uses: actions/download-artifact@v7
131+
with:
132+
name: rvi20_crd.html
133+
path: ./github-pages/crd
134+
135+
- name: Rename HTML files to index.html
136+
run: |
137+
mv ./github-pages/ctp/ctp.html ./github-pages/ctp/index.html
138+
mv ./github-pages/crd/rvi20_crd.html ./github-pages/crd/index.html
139+
140+
- name: Create index page
141+
run: |
142+
cat > ./github-pages/index.html << 'EOF'
143+
<!DOCTYPE html>
144+
<html>
145+
<head><title>RISC-V Certification Documentation</title></head>
146+
<body>
147+
<h1>RISC-V Certification Documentation</h1>
148+
<ul>
149+
<li><a href="ctp/">Certification Test Plan (CTP)</a></li>
150+
<li><a href="crd/">Certification Requirements Document (CRD)</a></li>
151+
</ul>
152+
</body>
153+
</html>
154+
EOF
155+
156+
- name: Upload pages artifact
157+
uses: actions/upload-pages-artifact@v4
158+
with:
159+
path: github-pages
160+
161+
- name: Deploy to GitHub Pages
162+
id: deployment
163+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ tests/rv64e
3737
tests/priv/Sm/Sm-00.S
3838
tests/priv/ExceptionsZc/ExceptionsZc-00.S
3939
# docs
40-
docs/ctp/src/norm
41-
docs/ctp/src/param
42-
docs/ctp/src/testplans
4340
docs/ctp/mismatch_report.txt
4441
docs/crd/build
4542
coverpoints/norm/norm-rules.json
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
include::../../docs-resources/global-config.adoc[]
1+
include::../docs-resources/global-config.adoc[]
22
include::symbols.adoc[]
3-
43
// Images
54
:imagesoutdir: {docdir}/../build/images-out
65
:imagesdir: ../docs-resources/images
76
:title-logo-image: image:risc-v_logo.png["RISC-V International Logo",pdfwidth=3.25in,align=center]
87
ifdef::draft-watermark[]
98
:page-background-image: image:/draft.png[opacity=20%]
109
endif::[]
11-
1210
// Misc Settings
1311
:preface-title: Licensing and Acknowledgements
1412
:colophon:
@@ -30,21 +28,17 @@ endif::[]
3028
:hide-uri-scheme:
3129
:stem:
3230
:footnote:
33-
3431
// Table of contents
3532
// Limit levels to level 0 (parts) and level 1 (2 equals signs).
3633
:toc: left
3734
:toclevels: 1
38-
3935
// The number of levels in the PDF outline. Max is 5.
4036
// See https://docs.asciidoctor.org/pdf-converter/latest/pdf-outline/#levels.
4137
:outlinelevels: 5
42-
4338
// A4 is the default for RISC-V but isn't wide enough for good display of tables.
4439
// See https://github.com/prawnpdf/pdf-core/blob/0.6.0/lib/pdf/core/page_geometry.rb#L16-L68
4540
:pdf-page-size: A3
4641

47-
4842
// Put the table of contents here when using the VSCode AsciiDoc previewer extension.
4943
// You also have to put the following in your settings.json file:
5044
// "asciidoc.preview.asciidoctorAttributes": {
File renamed without changes.

docs/crd/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ ifneq ($(SKIP_DOCKER),true)
4646
${DOCKER_BIN} run --rm \
4747
-v ${PWD}/$@.workdir:/build${DOCKER_VOL_SUFFIX} \
4848
-v ${PWD}/src:/src:ro${DOCKER_EXTRA_VOL_SUFFIX} \
49+
-v ${PWD}/../common:/common:ro${DOCKER_EXTRA_VOL_SUFFIX} \
4950
-v ${PWD}/../docs-resources:/docs-resources:ro${DOCKER_EXTRA_VOL_SUFFIX} \
5051
-w /build \
5152
$(DOCKER_USER_ARG) \
@@ -58,13 +59,13 @@ else
5859
endif
5960

6061
ifdef UNRELIABLE_BUT_FASTER_INCREMENTAL_BUILDS
61-
WORKDIR_SETUP = mkdir -p $@.workdir && ln -sfn ../../src ../../docs-resources $@.workdir/
62+
WORKDIR_SETUP = mkdir -p $@.workdir && ln -sfn ../../src ../../common ../../docs-resources $@.workdir/
6263
WORKDIR_TEARDOWN = mv $@.workdir/$@ $@
6364
else
6465
WORKDIR_SETUP = \
6566
rm -rf $@.workdir && \
6667
mkdir -p $@.workdir && \
67-
ln -sfn ../../src ../../docs-resources $@.workdir/
68+
ln -sfn ../../src ../../common ../../docs-resources $@.workdir/
6869

6970
WORKDIR_TEARDOWN = \
7071
mv $@.workdir/$@ $@ && \

docs/crd/src/rvi20_crd.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= RVI20 Certification Requirements Document (rev 0.3)
2-
include::adoc_common.adoc[]
32
:description: RVI20 CRD (Certificate Requirements Document)
3+
include::../../common/adoc_common.adoc[]
44

55
_Contributors to all versions of the spec in alphabetical order_
66

0 commit comments

Comments
 (0)