Skip to content

Commit 5076463

Browse files
authoredFeb 1, 2025
Fix CI P4Runtime Spec (p4lang#541)
* Bringing back the build folder Signed-off-by: Dscano <[email protected]> * Fix clean in Makefile Signed-off-by: Dscano <[email protected]> * Fix clean in Makefile, added remove svg Signed-off-by: Dscano <[email protected]> --------- Signed-off-by: Dscano <[email protected]>
1 parent 6af490f commit 5076463

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed
 

‎.github/workflows/any-branch-uploads.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ jobs:
1515
run: |
1616
make -C docs/tools/
1717
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc make
18-
ls docs/v1/P4Runtime-Spec.pdf
19-
ls docs/v1/P4Runtime-Spec.html
18+
ls docs/v1/build
2019
- name: Upload spec to S3 if needed
2120
if: ${{ github.actor != 'dependabot[bot]' }}
2221
uses: jakejarvis/s3-sync-action@v0.5.1
@@ -27,5 +26,5 @@ jobs:
2726
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
2827
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2928
AWS_REGION: 'us-west-2'
30-
SOURCE_DIR: 'docs/v1'
29+
SOURCE_DIR: 'docs/v1/build'
3130
DEST_DIR: ci/${{ github.ref_name }} # only runs for push events

‎.github/workflows/main-branch-uploads.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ jobs:
1818
run: |
1919
make -C docs/tools/
2020
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc make
21-
ls docs/v1/P4Runtime-Spec.pdf
22-
ls docs/v1/P4Runtime-Spec.html
21+
ls docs/v1/build
2322
- name: Upload spec to S3
2423
uses: jakejarvis/s3-sync-action@v0.5.1
2524
with:
@@ -29,15 +28,14 @@ jobs:
2928
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
3029
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
3130
AWS_REGION: 'us-west-2'
32-
SOURCE_DIR: 'docs/v1'
31+
SOURCE_DIR: 'docs/v1/build'
3332
DEST_DIR: docs/main
3433
- name: Prepare spec for upload to gh-pages
3534
run: |
3635
git checkout gh-pages
3736
mkdir -p spec
3837
rm -rf spec/main
39-
cp docs/v1/P4Runtime-Spec.html spec/main
40-
cp docs/v1/P4Runtime-Spec.pdf spec/main
38+
cp -r docs/v1/build spec/main
4139
- name: Upload spec to gh-pages
4240
uses: EndBug/add-and-commit@v9
4341
with:

‎.github/workflows/spec.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,4 @@ jobs:
2727
run: |
2828
make -C docs/tools/
2929
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc make build_spec_with_images
30-
ls docs/v1/P4Runtime-Spec.pdf
31-
ls docs/v1/P4Runtime-Spec.html
30+
ls docs/v1/build

‎.github/workflows/tag-uploads.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ jobs:
2020
run: |
2121
make -C docs/tools/
2222
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc make
23-
ls docs/v1/P4Runtime-Spec.pdf
24-
ls docs/v1/P4Runtime-Spec.html
23+
ls docs/v1/build
2524
- name: Upload spec to S3
2625
uses: jakejarvis/s3-sync-action@v0.5.1
2726
with:
@@ -38,8 +37,7 @@ jobs:
3837
git checkout gh-pages
3938
mkdir -p spec
4039
rm -rf spec/$TAG
41-
cp docs/v1/P4Runtime-Spec.html spec/$TAG
42-
cp docs/v1/P4Runtime-Spec.pdf spec/$TAG
40+
cp -r docs/v1/build spec/$TAG
4341
- name: Upload spec to gh-pages
4442
uses: EndBug/add-and-commit@v9
4543
with:

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Emacs
22
*~
3+
docs/v1/build/
34
.DS_Store
45
build
56
dist

‎docs/v1/Makefile

+10-5
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,27 @@ ROUGE_CSS=style
55

66
all: ${SPEC}.pdf ${SPEC}.html
77

8+
folder:
9+
mkdir -p build
10+
811
build:
912

10-
${SPEC}.pdf: ${SPEC}.adoc images
13+
${SPEC}.pdf: ${SPEC}.adoc images folder
1114
time asciidoctor-pdf -v \
1215
-a pdf-fontsdir=resources/fonts \
1316
-r asciidoctor-mathematical \
1417
-r asciidoctor-bibtex \
1518
-r asciidoctor-lists \
16-
-a rouge-style=$(ROUGE_STYLE) $<
19+
-a rouge-style=$(ROUGE_STYLE) \
20+
-D build $<
1721

18-
${SPEC}.html: ${SPEC}.adoc images
22+
${SPEC}.html: ${SPEC}.adoc images folder
1923
time asciidoctor -v \
2024
-r asciidoctor-mathematical \
2125
-r asciidoctor-bibtex \
2226
-r asciidoctor-lists \
23-
-a rouge-css=$(ROUGE_CSS) $<
27+
-a rouge-css=$(ROUGE_CSS) \
28+
-D build $<
2429

2530
images:
2631
soffice --convert-to svg --outdir resources/figs resources/figs/*.odg > /dev/null 2>&1
@@ -29,4 +34,4 @@ images:
2934
build_spec_with_images: images all
3035

3136
clean:
32-
/bin/rm -f ${SPEC}.pdf ${SPEC}.html
37+
/bin/rm -rf build resources/figs/*.png resources/figs/*.svg

0 commit comments

Comments
 (0)
Please sign in to comment.