From 5acaa2ed407dd884194dc375ef0a4a0a749f9b9a Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:11:23 +0300 Subject: [PATCH 01/14] #12 Tried to add a github workflow to build pdf --- .github/workflows/pandoc.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/pandoc.yml diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml new file mode 100644 index 0000000..793e1f7 --- /dev/null +++ b/.github/workflows/pandoc.yml @@ -0,0 +1,25 @@ +--- +name: Pandoc Document Compilation +on: push +jobs: + pandoc-compile: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Compile technical-task.md to pdf + uses: docker://pandoc/extra + with: + args: >- + --pdf-engine=xelatex + -V mainfont="Liberation Serif" + -s ./doc/technical-task.md + -o ./out/technical-task.pdf + + - name: Upload technical-task-pdf artifact + uses: actions/upload-artifact@v4 + with: + name: technical-task-pdf + path: out/technical-task.pdf + overwrite: true From 6ff1325bbfaf3e2419975d2a44d76dc4ce74ff94 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:14:19 +0300 Subject: [PATCH 02/14] #12 Run pandoc on pull_request --- .github/workflows/pandoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index 793e1f7..6cb6f64 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -1,6 +1,6 @@ --- name: Pandoc Document Compilation -on: push +on: pull_request jobs: pandoc-compile: runs-on: ubuntu-latest From 32787670aeab062beb55c8d0963e9068ad89c238 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:21:14 +0300 Subject: [PATCH 03/14] #12 Use latex instead of XeLaTeX --- .github/workflows/pandoc.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index 6cb6f64..e333190 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -12,10 +12,10 @@ jobs: uses: docker://pandoc/extra with: args: >- - --pdf-engine=xelatex - -V mainfont="Liberation Serif" - -s ./doc/technical-task.md - -o ./out/technical-task.pdf + -t latex + -V fontenc=T2A + -s doc/technical-task.md + -o out/technical-task.pdf - name: Upload technical-task-pdf artifact uses: actions/upload-artifact@v4 From a06b030c8a63ce6c2dd06d95b6e38dbcea59c2e2 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:23:31 +0300 Subject: [PATCH 04/14] #12 Tried to install texlive-lang-cyrillic --- .github/workflows/pandoc.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index e333190..266cbcb 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -8,6 +8,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Install required packages + run: | + sudo apt install texlive-lang-cyrillic + - name: Compile technical-task.md to pdf uses: docker://pandoc/extra with: From d51dfae5360d4c7629374e5a7b8a2cb015e43b86 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:38:05 +0300 Subject: [PATCH 05/14] #12 Tried r-lib/actions/setup-pandoc@v2 --- .github/workflows/pandoc.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index 266cbcb..ca78f37 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -8,14 +8,16 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Setup Pandoc + uses: r-lib/actions/setup-pandoc@v2 + - name: Install required packages run: | sudo apt install texlive-lang-cyrillic - name: Compile technical-task.md to pdf - uses: docker://pandoc/extra - with: - args: >- + run: | + pandoc -t latex -V fontenc=T2A -s doc/technical-task.md From 77bcffe979ca7b49327b00793c27316fa2f7c4f8 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:39:35 +0300 Subject: [PATCH 06/14] #12 Tried r-lib/actions/setup-pandoc@v2 --- .github/workflows/pandoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index ca78f37..e00777f 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -16,7 +16,7 @@ jobs: sudo apt install texlive-lang-cyrillic - name: Compile technical-task.md to pdf - run: | + run: >- pandoc -t latex -V fontenc=T2A From a23ff91f81e77f79915d5c75d67ad4be8b801cb5 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:41:03 +0300 Subject: [PATCH 07/14] #12 Tried to fix bash command --- .github/workflows/pandoc.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index e00777f..871b4e7 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -16,11 +16,11 @@ jobs: sudo apt install texlive-lang-cyrillic - name: Compile technical-task.md to pdf - run: >- - pandoc - -t latex - -V fontenc=T2A - -s doc/technical-task.md + run: | + pandoc \ + -t latex \ + -V fontenc=T2A \ + -s doc/technical-task.md \ -o out/technical-task.pdf - name: Upload technical-task-pdf artifact From 62541074328af4535aaed4428452cc570248b9e0 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:47:01 +0300 Subject: [PATCH 08/14] #12 Added package texlive-latex-recommended --- .github/workflows/pandoc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index 871b4e7..a84397d 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -14,6 +14,7 @@ jobs: - name: Install required packages run: | sudo apt install texlive-lang-cyrillic + sudo apt install texlive-latex-recommended - name: Compile technical-task.md to pdf run: | From 9234625bdac29f63ad6774a46c42410b71263c85 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:52:42 +0300 Subject: [PATCH 09/14] #12 Compile to tex and then into pdf --- .github/workflows/pandoc.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index a84397d..cbb3d5a 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -11,18 +11,19 @@ jobs: - name: Setup Pandoc uses: r-lib/actions/setup-pandoc@v2 - - name: Install required packages - run: | - sudo apt install texlive-lang-cyrillic - sudo apt install texlive-latex-recommended - - - name: Compile technical-task.md to pdf + - name: Convert .md to .tex run: | pandoc \ -t latex \ -V fontenc=T2A \ -s doc/technical-task.md \ - -o out/technical-task.pdf + -o out/technical-task.tex + + - name: Compile Latex + uses: xu-cheng/latex-action@v3 + with: + root_file: | + out/technical-task.tex - name: Upload technical-task-pdf artifact uses: actions/upload-artifact@v4 From 24f3f9d494d5bc4fde8d09d43be0aedc485c418f Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 11:58:29 +0300 Subject: [PATCH 10/14] #12 Tried to fix pandoc by directory creation --- .github/workflows/pandoc.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index cbb3d5a..002d403 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -11,13 +11,17 @@ jobs: - name: Setup Pandoc uses: r-lib/actions/setup-pandoc@v2 + - name: Prepare directories + run: | + mkdir out + - name: Convert .md to .tex run: | pandoc \ -t latex \ -V fontenc=T2A \ - -s doc/technical-task.md \ - -o out/technical-task.tex + -s ./doc/technical-task.md \ + -o ./out/technical-task.tex - name: Compile Latex uses: xu-cheng/latex-action@v3 From 14403cdcf2babe16713ed13c2e5732c4de27c02b Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 12:03:54 +0300 Subject: [PATCH 11/14] #12 Tried to fix latex build --- .github/workflows/markdown.yml | 5 ----- .github/workflows/pandoc.yml | 17 +++++++++-------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml index 265961a..2464f83 100644 --- a/.github/workflows/markdown.yml +++ b/.github/workflows/markdown.yml @@ -1,11 +1,6 @@ --- name: Markdown Check on: - push: - paths: - - ".github/workflows/*" - - ".markdownlint.yaml" - - "**/*.md" pull_request: paths: - ".github/workflows/*" diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index 002d403..7ba86c2 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -1,6 +1,10 @@ --- name: Pandoc Document Compilation -on: pull_request +on: + pull_request: + paths: + - ".github/workflows/*" + - "**/*.md" jobs: pandoc-compile: runs-on: ubuntu-latest @@ -11,27 +15,24 @@ jobs: - name: Setup Pandoc uses: r-lib/actions/setup-pandoc@v2 - - name: Prepare directories - run: | - mkdir out - - name: Convert .md to .tex run: | pandoc \ -t latex \ -V fontenc=T2A \ -s ./doc/technical-task.md \ - -o ./out/technical-task.tex + -o ./doc/technical-task.tex - name: Compile Latex uses: xu-cheng/latex-action@v3 with: + work_in_root_file_dir: true root_file: | - out/technical-task.tex + ./doc/technical-task.tex - name: Upload technical-task-pdf artifact uses: actions/upload-artifact@v4 with: name: technical-task-pdf - path: out/technical-task.pdf + path: doc/technical-task.pdf overwrite: true From 104d895eb2a8480f6cb6f46ea342ae69312efd3b Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 12:19:04 +0300 Subject: [PATCH 12/14] #12 Tried to cache docker image --- .github/workflows/pandoc.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index 7ba86c2..a743b0d 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -15,6 +15,11 @@ jobs: - name: Setup Pandoc uses: r-lib/actions/setup-pandoc@v2 + - name: Cache Docker images + uses: ScribeMD/docker-cache@0.3.7 + with: + key: docker-${{ runner.os }}-${{ hashFiles('.github/workflows/pandoc.yml') }} + - name: Convert .md to .tex run: | pandoc \ @@ -29,6 +34,8 @@ jobs: work_in_root_file_dir: true root_file: | ./doc/technical-task.tex + # This is included for Docker images caching + docker_image: ghcr.io/xu-cheng/texlive-full:20230801 - name: Upload technical-task-pdf artifact uses: actions/upload-artifact@v4 @@ -36,3 +43,4 @@ jobs: name: technical-task-pdf path: doc/technical-task.pdf overwrite: true + if-no-files-found: error From 3a82f623d230cc2d691251bcacd81485124a5a46 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 12:33:33 +0300 Subject: [PATCH 13/14] #12 Removed docker image caching --- .github/workflows/pandoc.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index a743b0d..f073848 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -15,11 +15,6 @@ jobs: - name: Setup Pandoc uses: r-lib/actions/setup-pandoc@v2 - - name: Cache Docker images - uses: ScribeMD/docker-cache@0.3.7 - with: - key: docker-${{ runner.os }}-${{ hashFiles('.github/workflows/pandoc.yml') }} - - name: Convert .md to .tex run: | pandoc \ @@ -34,8 +29,6 @@ jobs: work_in_root_file_dir: true root_file: | ./doc/technical-task.tex - # This is included for Docker images caching - docker_image: ghcr.io/xu-cheng/texlive-full:20230801 - name: Upload technical-task-pdf artifact uses: actions/upload-artifact@v4 From 20781a7f1e105b9f9f5bf362fc55e18107609e10 Mon Sep 17 00:00:00 2001 From: Victor Smirnov Date: Fri, 1 Mar 2024 12:39:10 +0300 Subject: [PATCH 14/14] #12 Removed docker image caching --- .github/workflows/markdown.yml | 1 + .github/workflows/pandoc.yml | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml index 2464f83..7bcedba 100644 --- a/.github/workflows/markdown.yml +++ b/.github/workflows/markdown.yml @@ -12,6 +12,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + - name: Run Markdownlint uses: nosborn/github-action-markdown-cli@v3.3.0 with: diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index f073848..a653d27 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -1,10 +1,9 @@ --- name: Pandoc Document Compilation on: - pull_request: - paths: - - ".github/workflows/*" - - "**/*.md" + push: + branches: + - trunk jobs: pandoc-compile: runs-on: ubuntu-latest