Skip to content

Commit

Permalink
Use docker for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Dec 10, 2021
1 parent 9a30eb7 commit 4618946
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/install-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e

export PATH="/tmp/texlive/bin/x86_64-linux:$PATH";

XECJK_PKGS="fontspec ulem xecjk xetex";
CTEX_PKGS="cjk ctex environ everysel trimspaces zhnumber";
ALGORITHM2E_PKGS="algorithm2e ifoddpage relsize";
BIBLATEX_PKGS="biber biblatex biblatex-gb7714-2015 xstring";
NOMENCL_PKGS="nomencl koma-script xkeyval";

BIN_PKGS="latexmk l3build";
REQUIRED_PKGS="$XECJK_PKGS $CTEX_PKGS caption footmisc filehook notoccite \
multirow titlesec unicode-math";
FONT_PKGS="fandol tex-gyre xits";
EXTRA_PKGS="$ALGORITHM2E_PKGS $BIBLATEX_PKGS $NOMENCL_PKGS siunitx";
DOC_PKGS="booktabs hypdoc listings xcolor";

tlmgr install $BIN_PKGS $REQUIRED_PKGS $FONT_PKGS $EXTRA_PKGS $DOC_PKGS;
21 changes: 6 additions & 15 deletions .github/workflows/install-texlive.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
#!/bin/bash
set -e

REMOTE="https://mirrors.ctan.org/systems/texlive/tlnet";
INSTALL="/tmp/install-texlive";

# install TeX Live & remove installer
mkdir -p "$INSTALL";
curl -sSL "$REMOTE/install-tl-unx.tar.gz" | tar -xz -C "$INSTALL" \
--strip-components=1;
"$INSTALL/install-tl" -no-gui -repository $REMOTE \
-profile .github/workflows/texlive.profile;
rm -rf "$INSTALL";

# add packages with tlmgr
export PATH="/tmp/texlive/bin/x86_64-linux:$PATH";

XECJK_PKGS="fontspec ulem xecjk xetex";
CTEX_PKGS="cjk ctex environ everysel trimspaces zhnumber";
ALGORITHM2E_PKGS="algorithm2e ifoddpage relsize";
BIBLATEX_PKGS="biber biblatex biblatex-gb7714-2015 xstring";
NOMENCL_PKGS="nomencl koma-script xkeyval";

BIN_PKGS="latexmk l3build";
REQUIRED_PKGS="$XECJK_PKGS $CTEX_PKGS caption footmisc filehook notoccite \
multirow titlesec unicode-math";
FONT_PKGS="fandol tex-gyre xits";
EXTRA_PKGS="$ALGORITHM2E_PKGS $BIBLATEX_PKGS $NOMENCL_PKGS siunitx";
DOC_PKGS="booktabs hypdoc listings xcolor";

tlmgr install $BIN_PKGS $REQUIRED_PKGS $FONT_PKGS $EXTRA_PKGS $DOC_PKGS;
21 changes: 8 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@ jobs:
test:

runs-on: ubuntu-latest

if: "!contains(github.event.head_commit.message, 'ci skip')"
container: tunathu/thuthesis-test-env
steps:
- uses: actions/checkout@v1
- name: Install TeX Live
run: bash .github/workflows/install-texlive.sh
- uses: actions/checkout@v2
- name: Install required packages
run: bash .github/workflows/install-packages.sh
- name: Test thesis
run: |
export PATH=/tmp/texlive/bin/x86_64-linux:$PATH
make main
run: make main
- name: Test doc
run: |
export PATH=/tmp/texlive/bin/x86_64-linux:$PATH
make doc
run: make doc
- name: l3build check
run: |
export PATH=/tmp/texlive/bin/x86_64-linux:$PATH
make test
run: make test

0 comments on commit 4618946

Please sign in to comment.