Commit 19a417e3 authored by liziwl's avatar liziwl
Browse files

add test files, update ci

parent a3f9da83
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
name: Verify compile for PR

on: pull_request

jobs:
  build_latex:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Compile LaTeX document
        uses: xu-cheng/texlive-action/full@v1
        with:
          run: |
            apk add make
            make test
      - name: Publish PDF as actions assets
        uses: actions/upload-artifact@v2
        with:
          name: PDF
          path: public-test/thuthesis-example*.pdf
+6 −13
Original line number Diff line number Diff line
name: Verify compile

on: [push, pull_request]
on:
  push:
    branches:
      - master

jobs:
  build_latex:
@@ -14,23 +17,13 @@ jobs:
        with:
          run: |
            apk add make
            make
      - name: Publish PDF as actions assets
        uses: actions/upload-artifact@v2
        with:
          name: PDF
          path: thuthesis-example.pdf

      - name: cp artifact
        run: |
          mkdir ./public
          cp thuthesis-example.pdf ./public
            make test

      - name: Deploy PDF
        uses: peaceiris/actions-gh-pages@v3
        if: github.ref == 'refs/heads/master'
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./public
          publish_dir: ./public-test
          publish_branch: latest
          force_orphan: true
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -34,3 +34,4 @@
*-converted-to.*

thuthesis-example.pdf
public*/
 No newline at end of file
+4 −1
Original line number Diff line number Diff line
@@ -14,12 +14,15 @@ else
	RM = rm -f
endif

.PHONY: all clean cleanall thesis viewthesis wordcount FORCE_MAKE
.PHONY: all clean cleanall thesis viewthesis wordcount test FORCE_MAKE

thesis: $(THESIS).pdf

all: thesis

test:
	bash test/test.sh

$(THESIS).pdf: FORCE_MAKE
	$(LATEXMK) $(THESIS)

test/test.sh

0 → 100644
+14 −0
Original line number Diff line number Diff line
#!/bin/zsh
set -x

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
mkdir "$SCRIPT_DIR/../public-test"

cp "$SCRIPT_DIR/thuthesis-example-cn.tex" "$SCRIPT_DIR/../thuthesis-example.tex"
make
cp "$SCRIPT_DIR/../thuthesis-example.pdf" "$SCRIPT_DIR/../public-test/thuthesis-example-cn.pdf"


cp "$SCRIPT_DIR/thuthesis-example-en.tex" "$SCRIPT_DIR/../thuthesis-example.tex"
make
cp "$SCRIPT_DIR/../thuthesis-example.pdf" "$SCRIPT_DIR/../public-test/thuthesis-example-en.pdf"
Loading