From ee25c919f69456f4d6bfd953c76154f9812b87c1 Mon Sep 17 00:00:00 2001 From: skyleaworlder <870033938@qq.com> Date: Tue, 14 Jun 2022 22:31:32 +0800 Subject: [PATCH 1/3] ci: init windows --- .github/ci/texlive-win.profile | 17 +++++++++++++++++ .github/workflows/test.yaml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/ci/texlive-win.profile diff --git a/.github/ci/texlive-win.profile b/.github/ci/texlive-win.profile new file mode 100644 index 0000000..40ee3d6 --- /dev/null +++ b/.github/ci/texlive-win.profile @@ -0,0 +1,17 @@ +# From latex3 & fduthesis +# https://github.com/latex3/latex3/blob/main/support/texlive.profile +# https://github.com/stone-zeng/fduthesis/blob/main/.github/workflows/texlive-win.profile + +# We use relative paths since the environment variables may not be resolved. + +selected_scheme scheme-infraonly +TEXDIR ../tmp/texlive +TEXMFSYSCONFIG ../tmp/texlive/texmf-config +TEXMFSYSVAR ../tmp/texlive/texmf-var +TEXMFLOCAL ../tmp/texlive/texmf-local +TEXMFHOME ../texmf +TEXMFCONFIG ../.texlive/texmf-config +TEXMFVAR ../.texlive/texmf-var +option_doc 0 +option_src 0 +tlpdbopt_autobackup 0 \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 327c674..24e4341 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -66,6 +66,40 @@ jobs: - name: compile LaTeX document run: | latexmk ${{ matrix.compiler }} -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape main + - name: upload pdf + uses: actions/upload-artifact@v2 + with: + name: document macos output + path: main.pdf + + build-windows: + runs-on: windows-latest + strategy: + matrix: + compiler: [-xelatex, -lualatex] + env: + SET_PATH: ${env:PATH} = "${{ github.workspace }}\tmp\texlive\bin\win32;" + ${env:PATH} + steps: + - name: checkout + uses: actions/checkout@v2 + - name: install Python for minted + uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: pip install Pygments for minted + run: pip install Pygments + - name: install TeXLive + run: | + ${{ env.SET_PATH }} + Invoke-WebRequest -Uri https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/install-tl.zip -OutFile install-tl.zip + Expand-Archive install-tl.zip -DestinationPath . + Set-Location install-tl-* + .\install-tl-windows --no-gui --profile ..\.github\ci\texlive-win.profile + tlmgr install ${{ env.TL_PACKAGES }} + tlmgr update --self --all --no-auto-install --repository=https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/ + - name: compile LaTeX document + run: | + latexmk ${{ matrix.compiler }} -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape main - name: upload pdf uses: actions/upload-artifact@v2 with: From 5b1df69ae0deee271df66e53c8538533e59d6829 Mon Sep 17 00:00:00 2001 From: skyleaworlder <870033938@qq.com> Date: Tue, 14 Jun 2022 22:38:12 +0800 Subject: [PATCH 2/3] ci: add path for tlmgr --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 24e4341..02bb085 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -99,6 +99,7 @@ jobs: tlmgr update --self --all --no-auto-install --repository=https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/ - name: compile LaTeX document run: | + ${{ env.SET_PATH }} latexmk ${{ matrix.compiler }} -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape main - name: upload pdf uses: actions/upload-artifact@v2 From 65d3c36675d9f695f7d157cf19930fd95887686e Mon Sep 17 00:00:00 2001 From: skyleaworlder <870033938@qq.com> Date: Tue, 14 Jun 2022 22:54:54 +0800 Subject: [PATCH 3/3] ci: fix output name --- .github/workflows/test.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 02bb085..19cb216 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,7 +19,7 @@ env: TL_PACKAGES: adjustbox algorithmicx algorithms caption cases chngcntr collectbox ctex enumitem environ extarrows fancybox fancyhdr float lastpage latexmk multirow needspace rsfs setspace subfigure tcolorbox texcount texliveonfly titling tocloft trimspaces ucs xcolor xecjk zhnumber gbt7714 natbib chinese-jfm catchfile fancyvrb framed fvextra ifplatform lineno minted pdftexcmds upquote xstring txfonts times biber biblatex bibtex dvips gsftopk jobs: - build-ubuntu: + build-linux: runs-on: ubuntu-latest strategy: matrix: @@ -31,12 +31,12 @@ jobs: uses: xu-cheng/texlive-action/full@v1 with: run: | - latexmk ${{ matrix.compiler }} -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape main + latexmk ${{ matrix.compiler }} -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape -jobname=linux${{ matrix.compiler }} main - name: upload pdf uses: actions/upload-artifact@v2 with: name: document linux output - path: main.pdf + path: linux${{ matrix.compiler }}.pdf build-macos: runs-on: macos-latest @@ -65,12 +65,12 @@ jobs: tlmgr path add - name: compile LaTeX document run: | - latexmk ${{ matrix.compiler }} -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape main + latexmk ${{ matrix.compiler }} -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape -jobname=macos${{ matrix.compiler }} main - name: upload pdf uses: actions/upload-artifact@v2 with: name: document macos output - path: main.pdf + path: macos${{ matrix.compiler }}.pdf build-windows: runs-on: windows-latest @@ -100,9 +100,9 @@ jobs: - name: compile LaTeX document run: | ${{ env.SET_PATH }} - latexmk ${{ matrix.compiler }} -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape main + latexmk ${{ matrix.compiler }} -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape -jobname=windows${{ matrix.compiler }} main - name: upload pdf uses: actions/upload-artifact@v2 with: - name: document macos output - path: main.pdf \ No newline at end of file + name: document windows output + path: windows${{ matrix.compiler }}.pdf \ No newline at end of file