Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix pipeline speed #79

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Install LibreOffice
if: github.ref == 'refs/heads/main'
run: |
set -ex
if $FIND -type f -iregex '.*\.xlsx$' -print | grep -q .
Expand All @@ -101,7 +102,7 @@ jobs:
- name: Convert EPS images to PDF
run: $FIND -type f -iregex '.*\.eps$' -print | parallel --halt now,fail=1 epstopdf {} {.}-eps-converted-to.pdf
- name: Convert XLSX spreadsheets to PDF
run: $FIND -type f -iregex '.*\.xlsx$' -print | parallel --halt now,fail=1 libreoffice7.3 --headless --convert-to pdf {} --outdir {//}
run: $FIND -type f -iregex '.*\.xlsx$' -print | parallel --halt now,fail=1 test ${{github.ref == 'refs/heads/main'}} = true '&&' libreoffice7.3 --headless --convert-to pdf {} --outdir {//} '||' ln -s '$(kpsewhich example-image.pdf)' {.}.pdf
- name: Compile LaTeX documents to PDF
run: $FIND -type f -iregex '.*\.tex$' -print | parallel --halt now,fail=1 test -e {//}/NO_PDF '||' latexmk -r istqb_product_base/latexmkrc {} '&&' '(test {} = ./example-document.tex || mv -v {.}.pdf "$(cat {.}.istqb_project_name).pdf")'
- name: Upload PDF documents
Expand All @@ -116,6 +117,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: witiko/markdown:3.6.0-10-g11b016ea-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Install required packages
run: |
Expand Down Expand Up @@ -159,6 +161,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: witiko/markdown:3.6.0-10-g11b016ea-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Install required packages
run: |
Expand Down
76 changes: 75 additions & 1 deletion template/istqb.cls
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{istqb}[2024/06/15 1.0.0 LaTeX class for ISTQB Documents]
\ProvidesClass{istqb}[2024/06/25 1.1.0 LaTeX class for ISTQB Documents]
\LoadClass[10pt]{article}

% Page layout
Expand Down Expand Up @@ -707,6 +707,80 @@
\tableofcontents
}

% Structure Tables
\ExplSyntaxOn
\tl_new:N
\l_istqb_external_document_basename_tl
\int_new:N
\l_istqb_external_document_last_page_int
\cs_new:Nn
\istqb_stucture_tables:n
{
\pdfximage
{ #1.pdf }
\int_gset:Nn
\l_istqb_external_document_last_page_int
{ \the\pdflastximagepages }
% Overview
\istqblandscapebegin
\int_compare:nNnTF
{ \l_istqb_external_document_last_page_int } > { 3 }
{
\includegraphics
[
page = 4,
trim = {1.75cm~7.5cm~1.75cm~0.75cm},
clip,
]
{ #1 }
}
{
% For placeholder or incorrect inputs, display at least page 1.
\centering
\includegraphics
[
page = 1,
keepaspectratio,
width = \linewidth,
height = 0.5\paperheight,
]
{ #1 }
}
\istqblandscapeend
% Structure Tables
\int_step_inline:nnn
{ 5 }
{ \l_istqb_external_document_last_page_int }
{
\centering
\includegraphics
[
page = #1,
height = 0.7\paperheight,
trim = {0.75cm~0.75cm~0.75cm~0.75cm},
clip,
]
{ #1 }
\par
}
}
\newcommand
\istqbstructuretables
[ 1 ]
{
\file_parse_full_name:nNNN
{ #1 }
\l_tmpa_tl
\l_istqb_external_document_basename_tl
\l_tmpb_tl
\istqb_stucture_tables:V
\l_istqb_external_document_basename_tl
}
\cs_generate_variant:Nn
\istqb_stucture_tables:n
{ V }
\ExplSyntaxOff

% Unicode characters
\RequirePackage{newunicodechar}
%% Subscripts
Expand Down