我正在尝试使用 appveyor 进行持续集成,但无法运行pdflatex
。到目前为止,我认为自己对 MikTeX 相当熟练,尽管这可能更像是一个 powershell 问题。
我能够通过 appveyor 安装和运行 TeX Live,但我想测试 MikTeX。
尝试 1:docker
我尝试使用 MikTeX 的docker
图像(https://miktex.org/howto/miktex-docker),但它似乎只适用于 GNU/Linux:
build_script:
- docker pull miktex/miktex
- docker volume create --name miktex
- docker run -ti \
-v miktex:/miktex/.miktex \
-v `pwd`:/miktex/work \
miktex/miktex \
pdflatex Report.tex
结果是:
> docker pull miktex/miktex
> Using default tag: latest
> latest: Pulling from miktex/miktex
> image operating system "linux" cannot be used on this platform
> Command exited with code 1
> 7z a failure.zip *.Rcheck\*
尝试 2:通过 chocolatey
init:
ps:
choco install miktex.portable
refreshenv
script:
- pdflatex Report.tex
结果:
‘pdflatex’ 不被识别为内部或外部命令、可运行程序或批处理文件
你可以假设它能Report.tex
编译。
答案1
氧合剂有一个可用的 appveyor miktex 安装在 https://github.com/doxygen/doxygen/blob/master/appveyor.yml
有趣的是:
install:
# Static url: https://github.com/MiKTeX/miktex/issues/321#issuecomment-496286866
# The setup is small enough, and does not need to be cached
- appveyor-retry appveyor DownloadFile https://miktex.org/download/win/miktexsetup-x64.zip
- 7z e miktexsetup-x64.zip
- appveyor-retry miktexsetup.exe --local-package-repository=C:\miktex-repository --package-set=essential download
- miktexsetup.exe --local-package-repository=C:\miktex-repository --package-set=essential --shared install
- refreshenv
答案2
我不确定您说的“规范”是什么意思。但这应该可行:
version: 1.0.{build}
image: Visual Studio 2017
install:
- ps: choco install -y miktex
- cmd: refreshenv
build_script:
- cmd: pdflatex .\Report.tex