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

main.yml 没有一致使用指定的 CTAN 镜像 #330

Open
muzimuzhi opened this issue Mar 20, 2024 · 0 comments
Open

main.yml 没有一致使用指定的 CTAN 镜像 #330

muzimuzhi opened this issue Mar 20, 2024 · 0 comments
Labels

Comments

@muzimuzhi
Copy link
Contributor

main.yml 没有一致使用存在 env.CTAN_URL 的 CTAN 镜像,会导致 CI 结果不稳定。

目前的 main.yml

  • 全局设置了环境变量 CTAN_URL,对应 rit 的 CTAN 镜像
  • 在每个 job 里,
    • 下载 install-tl 时,使用的是 env.CTAN_URL 指定的镜像
    • tlmgr install 安装宏包时,使用的是自动选择的 CTAN 镜像
    • tlmgr update --self --all 升级时,使用的是 env.CTAN_URL 指定的镜像
  • tlmgr update 这一步,如果 rit 的镜像比安装宏包时连接的 CTAN 镜像要老,就会产生错误,导致 CI 失败。
    • 例如,在 job run #8353869319 里,tlmgr install 时连接了较新的 princeton 的镜像,于是在 tlmgr update 时报错,整个 build-ubuntu job 失败。
      tlmgr: Remote database (revision 70684 of the texlive-scripts package)
      seems to be older than the local installation (rev 70707 of
      texlive-scripts); please use a different mirror and/or wait a day or two.
      
      但是,在 build-windows job 里,tlmgr install 一步连接的是 illinois 的镜像,这个 job 就没有失败。

env:
CTAN_URL: https://mirrors.rit.edu/CTAN

- name: Install TeX Live
run: |
${{ env.SET_PATH }}
wget ${{ env.CTAN_URL }}/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -xzf install-tl-unx.tar.gz
cd install-tl-20* && ./install-tl --profile ../.github/workflows/texlive.profile
tlmgr install ${{ env.TL_PACKAGES }}
tlmgr update --self --all --no-auto-install --repository=${{ env.CTAN_URL }}/systems/texlive/tlnet/

从提高 CI 结果稳定性的角度,tlmgr 的所有命令都支持 --repository 选项,也可以通过 tlmgr option repository <uri> 一次性设置。

从简化 workflow 设置、缩短 CI 运行时间的角度,也许可以像 CTeX-org/ctex-kit 里那样(CTeX-org/ctex-kit@dc9e68d ),使用 action teatimeguest/setup-texlive-action。它能自动缓存 texlive 安装目录、自动设置 PATH,最近也支持了指定 CTAN 镜像 (v3.1.0)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants