Skip to content

Commit da2507a

Browse files
committed
Rearrange scripts for PDF generation
All the files related to PDF generation have been moved into a new directory called 'pdf'. Moreover, the script build_with_docker.sh has been renamed to build-pdfs.sh because another script will be added to build the GitHub Pages, so this name is more specific about what it actually does.
1 parent 7d664b5 commit da2507a

18 files changed

Lines changed: 57 additions & 62 deletions

.github/workflows/ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
# SPDX-FileCopyrightText: Copyright 2021 Arm Limited and/or its affiliates <open-source-office@arm.com>
1+
# SPDX-FileCopyrightText: Copyright 2021, 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
22
#
33
# SPDX-License-Identifier: Apache-2.0
44
name: CI
55

66
on: [push, pull_request]
77

88
jobs:
9-
build:
9+
build-pdfs:
1010
runs-on: ubuntu-latest
11-
1211
steps:
13-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1413
- name: check the correctness of the sources and generate the PDFs
15-
run: ./build_with_docker.sh
16-
- uses: actions/upload-artifact@v2
14+
run: ./tools/build-pdfs.sh
15+
- uses: actions/upload-artifact@v3
1716
with:
1817
name: pdfs
19-
path: pdfs
18+
path: output_pdfs
2019

2120
markdown-link-check:
2221
runs-on: ubuntu-latest
2322
steps:
24-
- uses: actions/checkout@master
23+
- uses: actions/checkout@v3
2524
- uses: gaurav-nelson/github-action-markdown-link-check@v1
2625
with:
2726
config-file: '.github/workflows/markdown-link-check.json'
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
set -x
77
IMAGE_NAME=acle_build
88
# Build the image.
9-
docker build -t $IMAGE_NAME tools/docker
9+
docker build -t $IMAGE_NAME tools/pdf/docker
1010
# Run the image, mounting the current folder into the /src folder of
1111
# the docker image.
12-
docker run --rm --mount type=bind,source="$(pwd)",target=/src $IMAGE_NAME
12+
ROOTDIR=$(realpath "$(dirname "$(realpath "$0")")/..")
13+
docker run --rm -v "$ROOTDIR":/src $IMAGE_NAME

tools/docker/Dockerfile

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

tools/pdf/docker/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: Copyright 2021, 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
2+
# SPDX-License-Identifier: Apache-2.0
3+
# syntax=docker/dockerfile:1
4+
5+
FROM debian:bullseye-slim
6+
7+
RUN apt update
8+
RUN apt upgrade -y
9+
RUN apt install -y ruby
10+
RUN apt install -y pandoc
11+
RUN apt install -y inkscape
12+
RUN apt install -y librsvg2-bin
13+
RUN apt install -y python3
14+
RUN apt install -y python3-tabulate
15+
RUN apt install -y texlive-latex-extra
16+
RUN apt install -y texlive-fonts-extra
17+
18+
COPY entrypoint.sh /entrypoint.sh
19+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ls -al
99

1010
# Generate the intrinsic specifications and the PDFs. If this step
1111
# fails at any point, stop the docker run.
12-
/src/tools/hyperref-check.sh || exit 1
13-
/src/tools/generate-intrinsics-specs.sh || exit 1
14-
/src/tools/generate-pdfs.sh || exit 1
12+
/src/tools/pdf/hyperref-check.sh || exit 1
13+
/src/tools/pdf/generate-intrinsics-specs.sh || exit 1
14+
/src/tools/pdf/generate-pdfs.sh || exit 1
15+
rm -rf tmp
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ function check_changes() {
3232
# Function that invokes the script to generate the md out of the db
3333
# of the specs.
3434
function generate_specs() {
35-
./tools/gen-intrinsics-specs.py --intrinsic-defs $1 \
35+
./tools/pdf/gen-intrinsics-specs.py --intrinsic-defs $1 \
3636
--classification $2 \
3737
--template $3 --outfile $4 \
3838
--workflow $5
3939
}
4040

4141
# Generate specs
42-
generate_specs ./tools/intrinsic_db/advsimd.csv \
43-
./tools/intrinsic_db/advsimd_classification.csv \
42+
generate_specs ./tools/pdf/intrinsic_db/advsimd.csv \
43+
./tools/pdf/intrinsic_db/advsimd_classification.csv \
4444
./neon_intrinsics/advsimd.template.md \
4545
./tmp/advsimd.new.md \
4646
markdown
4747

48-
generate_specs ./tools/intrinsic_db/mve.csv \
49-
./tools/intrinsic_db/mve_classification.csv \
48+
generate_specs ./tools/pdf/intrinsic_db/mve.csv \
49+
./tools/pdf/intrinsic_db/mve_classification.csv \
5050
./mve_intrinsics/mve.template.md \
5151
./tmp/mve.new.md \
5252
markdown
@@ -56,14 +56,14 @@ check_changes ./tmp/advsimd.new.md ./neon_intrinsics/advsimd.md
5656
check_changes ./tmp/mve.new.md ./mve_intrinsics/mve.md
5757

5858
# Generate tmp file for pdfs
59-
generate_specs ./tools/intrinsic_db/mve.csv \
60-
./tools/intrinsic_db/mve_classification.csv \
59+
generate_specs ./tools/pdf/intrinsic_db/mve.csv \
60+
./tools/pdf/intrinsic_db/mve_classification.csv \
6161
./mve_intrinsics/mve.template.md \
6262
./tmp/mve.for-pdf.md \
6363
pdf
6464

65-
generate_specs ./tools/intrinsic_db/advsimd.csv \
66-
./tools/intrinsic_db/advsimd_classification.csv \
65+
generate_specs ./tools/pdf/intrinsic_db/advsimd.csv \
66+
./tools/pdf/intrinsic_db/advsimd_classification.csv \
6767
./neon_intrinsics/advsimd.template.md \
6868
./tmp/advsimd.for-pdf.md \
6969
pdf
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ function generate_pdfs_from_md() {
3636
# in the specific case of the cmse.md file.
3737
sed -u ':a;N;$!ba;s/\*\sTOC\n{*{:toc}}*//' $inputMdFile | \
3838
sed -u "s/<!--latex_geometry_conf-->/$geometryForIntrinsics/" | \
39-
pandoc --template=tools/acle_template.tex -o $outputPdfFile --resource-path=$(dirname $inputMdFile)
39+
pandoc --template=tools/pdf/acle_template.tex -o $outputPdfFile --resource-path=$(dirname $inputMdFile):.
4040
}
4141

42-
mkdir -p pdfs tmp
42+
mkdir -p output_pdfs tmp
4343

4444
# Convert svg image to pdf for use in pdf generation via pandoc.
45-
inkscape -z Arm_logo_blue_RGB.svg -e tmp/Arm-logo-blue-RGB.pdf
45+
inkscape Arm_logo_blue_RGB.svg -o tmp/Arm-logo-blue-RGB.pdf
4646

47-
generate_pdfs_from_md ./cmse/cmse.md ./pdfs/cmse.pdf
48-
generate_pdfs_from_md ./morello/morello.md ./pdfs/morello.pdf
49-
generate_pdfs_from_md ./main/acle.md ./pdfs/acle.pdf
50-
generate_pdfs_from_md ./tmp/mve.for-pdf.md ./pdfs/mve.pdf
51-
generate_pdfs_from_md ./tmp/advsimd.for-pdf.md ./pdfs/advsimd.pdf
47+
generate_pdfs_from_md ./cmse/cmse.md ./output_pdfs/cmse.pdf
48+
generate_pdfs_from_md ./morello/morello.md ./output_pdfs/morello.pdf
49+
generate_pdfs_from_md ./main/acle.md ./output_pdfs/acle.pdf
50+
generate_pdfs_from_md ./tmp/mve.for-pdf.md ./output_pdfs/mve.pdf
51+
generate_pdfs_from_md ./tmp/advsimd.for-pdf.md ./output_pdfs/advsimd.pdf

0 commit comments

Comments
 (0)