From 0d3c945a178a9aa5ed1b6316c359b54e2f634bbd Mon Sep 17 00:00:00 2001 From: Georg Teufelberger <55834264+tgeorg-ethz@users.noreply.github.com> Date: Wed, 22 May 2024 14:58:20 +0200 Subject: [PATCH] ci: Compile all procedures in a single step (#52) instead of adding a CI step for every procedure --- .github/workflows/compile-latex.yml | 28 ++++++++------------------- .github/workflows/tagpr.yml | 30 ++++++++--------------------- 2 files changed, 16 insertions(+), 42 deletions(-) diff --git a/.github/workflows/compile-latex.yml b/.github/workflows/compile-latex.yml index ac3ac8f..5c5d37d 100644 --- a/.github/workflows/compile-latex.yml +++ b/.github/workflows/compile-latex.yml @@ -7,27 +7,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Compile LaTeX document - uses: xu-cheng/latex-action@v3 - with: - working_directory: src/dacs-sw/control-station-installation/ - root_file: main.tex - work_in_root_file_dir: true - - - name: Compile LaTeX template document - uses: xu-cheng/latex-action@v3 - with: - working_directory: src/dacs-sw/template/ - root_file: main.tex - work_in_root_file_dir: true + - name: Compile all LaTeX documents + run: | + projects=("control-station-installation" "template" "database-ingestion") + for project in "${projects[@]}"; do + working_directory="src/dacs-sw/$project" + root_file="main.tex" + docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace/$working_directory texlive/texlive:latest latexmk -pdf -interaction=nonstopmode $root_file + done - - name: Compile LaTeX data ingestion document - uses: xu-cheng/latex-action@v3 - with: - working_directory: src/dacs-sw/database-ingestion/ - root_file: main.tex - work_in_root_file_dir: true - - name: Rename files and move to single release folder run: | mkdir --parents release diff --git a/.github/workflows/tagpr.yml b/.github/workflows/tagpr.yml index e4ea823..6b2cb35 100644 --- a/.github/workflows/tagpr.yml +++ b/.github/workflows/tagpr.yml @@ -19,29 +19,15 @@ jobs: run: | sed -i 's/\\setboolean{isDraft}{true}/\\setboolean{isDraft}{false}/' src/dacs-sw/control-station-installation/main.tex - - name: Compile LaTeX document + - name: Compile all LaTeX documents if: ${{ steps.tagpr.outputs.tag != '' }} - uses: xu-cheng/latex-action@v3 - with: - working_directory: src/dacs-sw/control-station-installation/ - root_file: main.tex - work_in_root_file_dir: true - - - name: Compile LaTeX template document - if: ${{ steps.tagpr.outputs.tag != '' }} - uses: xu-cheng/latex-action@v3 - with: - working_directory: src/dacs-sw/template/ - root_file: main.tex - work_in_root_file_dir: true - - - name: Compile LaTeX database ingestion document - if: ${{ steps.tagpr.outputs.tag != '' }} - uses: xu-cheng/latex-action@v3 - with: - working_directory: src/dacs-sw/database-ingestion/ - root_file: main.tex - work_in_root_file_dir: true + run: | + projects=("control-station-installation" "template" "database-ingestion") + for project in "${projects[@]}"; do + working_directory="src/dacs-sw/$project" + root_file="main.tex" + docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace/$working_directory texlive/texlive:latest latexmk -pdf -interaction=nonstopmode $root_file + done - name: Rename files and move to single release folder if: ${{ steps.tagpr.outputs.tag != '' }}