Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dpo committed Nov 10, 2023
0 parents commit 9dc35dc
Show file tree
Hide file tree
Showing 16 changed files with 3,119 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build-latex-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build LaTeX diff document
on:
push:
branches:
- master
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
build_latex:
runs-on: ubuntu-latest
env:
PAPER: ${{ github.event.repository.name }}
MAIN: ${{ github.event.pull_request.base.sha }}
steps:
- name: Set up Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compile LaTeX diff
uses: xu-cheng/latex-action@v3
with:
root_file: |
${{ env.PAPER }}-diff${{ env.MAIN }}.tex
working_directory: .
extra_system_packages: "git patch"
latexmk_shell_escape: true
pre_compile: git config --global --add safe.directory /github/workspace && latexdiff-vc --git --flatten --disable-auto-mbox --exclude-safecmd="Cref,Cref\*,hspace" -r ${{ env.MAIN }} ${{ env.PAPER }}.tex
env:
TEXINPUTS: ".:$PWD/../latex-styles-master/styles//:"
BSTINPUTS: ".:$PWD/../latex-styles-master/styles/common"
BIBINPUTS: ".:$PWD/../latex-styles-master/share"
- name: Upload PDF
uses: actions/upload-artifact@v2
with:
name: DiffPDF
path: |
${{ env.PAPER }}-diff${{ env.MAIN }}.pdf
38 changes: 38 additions & 0 deletions .github/workflows/build-latex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build LaTeX document
on:
push:
branches:
- master
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
build_latex:
runs-on: ubuntu-latest
env:
PAPER: ${{ github.event.repository.name }}
steps:
- name: Set up Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v3
with:
root_file: |
${{ env.PAPER }}.tex
working_directory: .
extra_system_packages: "git patch"
latexmk_shell_escape: true
pre_compile: git config --global --add safe.directory /github/workspace
env:
TEXINPUTS: ".:$PWD/../latex-styles-master/styles//:"
BSTINPUTS: ".:$PWD/../latex-styles-master/styles/common"
BIBINPUTS: ".:$PWD/../latex-styles-master/share"
- name: Upload PDF
uses: actions/upload-artifact@v3
with:
name: PDF
path: |
${{ env.PAPER }}.pdf
26 changes: 26 additions & 0 deletions .github/workflows/latexindent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: latexindent

on:
push:
branches:
- 'main'
- 'master'

jobs:
build:
runs-on: macos-latest
steps:
- name: Checking out repository
uses: actions/checkout@v3
- name: Install latexindent
run: brew install latexindent
- name: Run latexindent
id: run-latexindent
run: |
shopt -s nullglob # allow empty loops below
cd paper
for f in *.tex; do latexindent -l ./localSettings.yaml -m -r -w $f; done
for f in *.bib; do latexindent -l ./localSettings.yaml -m -r -w $f; done
rm *.bak[0-9]
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ChkTeX

on:
pull_request:
branches:
- master
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v4
- name: LaTeX linter (chktex)
uses: dpo/chktex-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build comment
id: build-comment
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
result-encoding: string
script: |
const fs = require('fs');
return "Chktex output: \n```\n" + fs.readFileSync("${{ github.workspace }}/chktex_output.txt", "utf8").toString() + "```";
- name: Comment in PR
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: ${{ steps.build-comment.outputs.result }}
19 changes: 19 additions & 0 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: add artifact links to pr
on:
workflow_run:
workflows: ["Build LaTeX document", "Build LaTeX diff document"]
types: [completed]

jobs:
artifacts-url-comments:
name: add artifact links to pull request and related issues job
runs-on: [ubuntu-latest]
steps:
- name: add artifact links to pull request and related issues step
uses: veitbjarsch/artifacts-url-comments@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prefix: "Here is the compiled"
format: "name"
addTo: "pull"
5 changes: 5 additions & 0 deletions code/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code

Put all the code necessary to reproduce numerical results here.
All results, tables and figures should be generated by running a single script.
Add a `Project.toml` with appropriate versions here so results can be reproduced.
Loading

0 comments on commit 9dc35dc

Please sign in to comment.