-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
使用latexindent不必安装texlive。 同时分离lint与test的workflow。
- Loading branch information
Showing
8 changed files
with
54 additions
and
103 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,31 @@ | ||
name: Lint | ||
on: | ||
pull_request: | ||
branches: main | ||
|
||
jobs: | ||
lint: | ||
name: Lint code | ||
runs-on: ubuntu-18.04 | ||
env: | ||
cache-version: v20210203.1 | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Cache | ||
id: cache | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
latexindent | ||
/opt/hostedtoolcache/perl | ||
key: lint-${{ runner.os }}-${{ env.cache-version }} | ||
- name: Install latexindent | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: source ci/latexindent-install.sh | ||
- name: Setup Perl environment (for cpanm) | ||
uses: shogo82148/[email protected] | ||
- name: Install Perl dependencies | ||
run: source ci/latexindent-deps-install.sh | ||
- name: Check format | ||
run: source ci/latexindent.sh |
This file was deleted.
Oops, something went wrong.
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,57 +1,11 @@ | ||
name: CI | ||
name: Test | ||
on: | ||
push: | ||
branches: main | ||
pull_request: | ||
branches: main | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-18.04 | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
env: | ||
cache-version: v20210203.1 | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Set up PATH | ||
run: echo "/tmp/texlive/bin/x86_64-linux" >> $GITHUB_PATH | ||
- name: Cache | ||
id: cache | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
/tmp/texlive | ||
/opt/hostedtoolcache/perl | ||
key: ${{ runner.os }}-texlive-${{ hashFiles('.github/workflows/perl-modules') }}-${{ env.cache-version }} | ||
- name: Download install-tl.zip | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
curl -sOL http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip | ||
unzip -q install-tl.zip | ||
mv install-tl-2* install-tl-dir | ||
- name: Run install-tl | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: install-tl-dir/install-tl --profile .github/workflows/texlive-linux.profile | ||
- name: Run tlmgr install | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
tlmgr update --self | ||
tlmgr install latex-bin latexindent | ||
- name: Setup Perl environment | ||
uses: shogo82148/[email protected] | ||
- name: Install some other perl dependencies | ||
run: cpanm $(cat .github/workflows/perl-modules) | ||
- name: Check format | ||
run: | | ||
set -e | ||
for f in $(find -name '*.tex' \ | ||
-or -name '*.cls' \ | ||
-or -name '*.bib'); do | ||
latexindent -l "$f" | diff "$f" - | ||
done | ||
# CTAN没有一个提供像npm那样的依赖管理机制, | ||
# 个人觉得这样宽松的依赖下进行l3build严格的对比机制不是太合理的 | ||
# 也许前一天能通过的测试,第二天由于依赖的包更新就无法通过了 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -ev | ||
|
||
echo Y | latexindent/latexindent-module-installer.pl |
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,6 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -ev | ||
|
||
curl -sOL http://mirrors.ctan.org/support/latexindent.zip | ||
unzip -q latexindent.zip |
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,11 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -ev | ||
|
||
for f in $(find \ | ||
-path ./latexindent -prune -false \ | ||
-or -name '*.tex' \ | ||
-or -name '*.cls' \ | ||
-or -name '*.bib'); do | ||
latexindent/latexindent.pl -l "$f" | diff "$f" - | ||
done |