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)。
main.yml没有一致使用存在env.CTAN_URL的 CTAN 镜像,会导致 CI 结果不稳定。目前的
main.yml,CTAN_URL,对应 rit 的 CTAN 镜像install-tl时,使用的是env.CTAN_URL指定的镜像tlmgr install安装宏包时,使用的是自动选择的 CTAN 镜像tlmgr update --self --all升级时,使用的是env.CTAN_URL指定的镜像tlmgr update这一步,如果 rit 的镜像比安装宏包时连接的 CTAN 镜像要老,就会产生错误,导致 CI 失败。tlmgr install时连接了较新的 princeton 的镜像,于是在tlmgr update时报错,整个build-ubuntujob 失败。build-windowsjob 里,tlmgr install一步连接的是 illinois 的镜像,这个 job 就没有失败。fduthesis/.github/workflows/main.yml
Lines 5 to 6 in d84e0dd
fduthesis/.github/workflows/main.yml
Lines 25 to 32 in d84e0dd
从提高 CI 结果稳定性的角度,
tlmgr的所有命令都支持--repository选项,也可以通过tlmgr option repository <uri>一次性设置。从简化 workflow 设置、缩短 CI 运行时间的角度,也许可以像
CTeX-org/ctex-kit里那样(CTeX-org/ctex-kit@dc9e68d ),使用 actionteatimeguest/setup-texlive-action。它能自动缓存 texlive 安装目录、自动设置 PATH,最近也支持了指定 CTAN 镜像 (v3.1.0)。