-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR: #15 from Eternal-Night-Archer/fix-ci
add: ci for macos
- Loading branch information
Showing
5 changed files
with
85 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# From latex3 & fduthesis | ||
# https://github.com/latex3/latex3/blob/main/support/texlive.profile | ||
# https://github.com/stone-zeng/fduthesis/blob/main/.github/workflows/texlive.profile | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,73 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- fix-ci | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
name: test | ||
|
||
env: | ||
# gbt7714 natbib: gbt7714 needed | ||
# chinese-jfm: lualatex needed | ||
# catchfile fancyvrb framed fvextra ifplatform lineno minted pdftexcmds upquote xstring: minted needed | ||
# biber biblatex bibtex: for executable bibtex | ||
# txfonts: mathptmx is obsoleted; times: times is obsoleted but utmb8a.pfb is needed | ||
# dvips: for 8r.enc, OS X needed; gsftopk: command needed when xdv -> pdf | ||
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-xelatex: | ||
build-ubuntu: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
compiler: [-xelatex, -lualatex] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: compile LaTeX document | ||
uses: xu-cheng/texlive-action/full@v1 | ||
with: | ||
run: "latexmk -xelatex -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape main" | ||
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 output | ||
name: document linux output | ||
path: main.pdf | ||
|
||
build-lualatex: | ||
runs-on: ubuntu-latest | ||
build-macos: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
compiler: [-xelatex, -lualatex] | ||
env: | ||
SET_PATH: export PATH=/tmp/texlive/bin/universal-darwin:/usr/texbin:$PATH | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: compile LaTeX document | ||
uses: xu-cheng/texlive-action/full@v1 | ||
- name: install Python for minted | ||
uses: actions/setup-python@v4 | ||
with: | ||
run: "latexmk -lualatex -interaction=nonstopmode -file-line-error -halt-on-error -shell-escape main" | ||
python-version: '3.9' | ||
- name: pip install Pygments for minted | ||
run: pip install Pygments | ||
- name: install TeXLive | ||
run: | | ||
${{ env.SET_PATH }} | ||
curl -O https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz | ||
tar -xzf install-tl-unx.tar.gz | ||
cd install-tl-20* && ./install-tl --profile ../.github/ci/texlive.profile | ||
tlmgr install ${{ env.TL_PACKAGES }} | ||
tlmgr update --self --all --no-auto-install --repository=https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/ | ||
tlmgr path add | ||
- 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 output | ||
name: document macos output | ||
path: main.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,34 +28,18 @@ | |
|
||
#### i. 使用 tlmgr | ||
|
||
通过 [此处](https://tug.org/texlive/acquire.html) 下载 TeXLive,并使用 `tlmgr` 下载宏包: | ||
下载 TeXLive,并使用 `tlmgr` 下载宏包: | ||
|
||
```shell | ||
# Install BasicTex: https://mirrors.chevalier.io/CTAN/systems/mac/mactex/mactex-basictex-20210325.pkg | ||
# The following commands aims at installing packages upon TeXLive without any packages. | ||
# You can also install BasicTex: https://mirrors.chevalier.io/CTAN/systems/mac/mactex/mactex-basictex-20210325.pkg | ||
sudo tlmgr update --self | ||
|
||
sudo tlmgr install texliveonfly | ||
sudo tlmgr install latexmk | ||
sudo tlmgr install adjustbox | ||
sudo tlmgr install tcolorbox | ||
sudo tlmgr install collectbox | ||
sudo tlmgr install ucs | ||
sudo tlmgr install environ | ||
sudo tlmgr install titling | ||
sudo tlmgr install enumitem | ||
sudo tlmgr install rsfs | ||
sudo tlmgr install tocloft | ||
sudo tlmgr install xcolor | ||
sudo tlmgr install trimspaces | ||
sudo tlmgr install zhnumber | ||
sudo tlmgr install ctex | ||
sudo tlmgr install texcount | ||
sudo tlmgr install needspace | ||
sudo tlmgr install xecjk | ||
sudo tlmgr install subfigure | ||
sudo tlmgr install cases | ||
sudo tlmgr install algorithms | ||
sudo tlmgr install multirow | ||
sudo tlmgr install adjustbox algorithm \ | ||
cases caption chngcntr collectbox ctex enumerate enumitem environ extarrows fancybox fancyhdr \ | ||
lastpage latexmk longtable mathptmx minted multirow needspace rsfs setspace subfigure \ | ||
tcolorbox texcount texliveonfly tikz titling \ | ||
tocloft trimspaces ucs verbatim xcolor xecjk zhnumber | ||
|
||
sudo tlmgr update --self --all | ||
``` | ||
|
@@ -135,6 +119,12 @@ make wordcount # wordcount | |
* 点击左侧边栏中带有 TEX 图标的 LaTeX 按钮; | ||
* 点击 `Build LaTeX project` 列表中的 `Recipe: latexmk (xelatex)` 编译 `.pdf` 文件。 | ||
|
||
### 6. 在 GitHub Actions 中编译 | ||
|
||
项目以 `.github/workflows/*.yaml` 配置了 GitHub Actions,push 代码到 fork 仓库或 template-generated 仓库均可触发测试。可通过 commit 对应的 workflow run 中的 `Summary | Artifacts` 获得多平台构建产物。 | ||
|
||
(通过勾选 `Settings | Actions | General | Allow all actions and reusable workflows` 打开 GitHub Actions) | ||
|
||
## 如何为该项目贡献代码? | ||
|
||
还请查看 [How to pull request](CONTRIBUTING.md/#how-to-pull-request)。 | ||
|
@@ -168,6 +158,7 @@ by Sam Hocevar <[email protected]> | |
我们从顶尖高校的优秀开源项目中学到了很多: | ||
|
||
* [sjtug/SJTUThesis](https://github.com/sjtug/SJTUThesis): makefile & batchfile | ||
* [stone-zeng/fduthesis](https://github.com/stone-zeng/fduthesis): workflows | ||
|
||
## 联系方式 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters