Skip to content

Commit

Permalink
Add LaTeX actions (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy authored Oct 27, 2023
1 parent 11e538f commit 4061356
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 0 deletions.
15 changes: 15 additions & 0 deletions actions/dropbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Dropbox

This action can be used in the following manner:

```yaml
jobs:
chktex:
runs-on: ubuntu-latest
steps:
- uses: paddyroddy/.github/actions/[email protected]
with:
files-to-upload: "example.pdf"
```
where `x.y.z` is the `major.minor.patch` version of the action.
39 changes: 39 additions & 0 deletions actions/dropbox/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Dropbox
description: Upload files to Dropbox

inputs:
files-to-upload:
description: A list of files to upload to dropbox
required: true

runs:
using: composite
steps:
- name: checkout source
uses: actions/checkout@v4

- name: Set up Dropbox
run: |
echo "CONFIGFILE_VERSION=$CONFIGFILE_VERSION" > ~/.dropbox_uploader
echo "OAUTH_APP_KEY=$OAUTH_APP_KEY" >> ~/.dropbox_uploader
echo "OAUTH_APP_SECRET=$OAUTH_APP_SECRET" >> ~/.dropbox_uploader
echo "OAUTH_REFRESH_TOKEN=$OAUTH_REFRESH_TOKEN" >> ~/.dropbox_uploader
env:
CONFIGFILE_VERSION: ${{secrets.CONFIGFILE_VERSION}}
OAUTH_APP_KEY: ${{secrets.OAUTH_APP_KEY}}
OAUTH_APP_SECRET: ${{secrets.OAUTH_APP_SECRET}}
OAUTH_REFRESH_TOKEN: ${{secrets.OAUTH_REFRESH_TOKEN}}

- name: Retrieve Dropbox uploader script
run: |
curl "https://raw.githubusercontent.com/andreafabrizi/\
Dropbox-Uploader/master/dropbox_uploader.sh" \
-o dropbox_uploader.sh
chmod +x dropbox_uploader.sh
- name: Upload PDF
run: |
for file in ${{ inputs.files-to-upload }}; do \
echo $file; \
./dropbox_uploader.sh upload $file $file; \
done
5 changes: 5 additions & 0 deletions actions/latex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# LaTeX Composite Actions

A set of
[composite actions](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action)
specific to LaTeX, that can be called by other workflows.
13 changes: 13 additions & 0 deletions actions/latex/chktex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# chktex

This action can be used in the following manner:

```yaml
jobs:
chktex:
runs-on: ubuntu-latest
steps:
- uses: paddyroddy/.github/actions/latex/[email protected]
```
where `x.y.z` is the `major.minor.patch` version of the action.
18 changes: 18 additions & 0 deletions actions/latex/chktex/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: ChkTeX
description: Runs ChkTeX over all TeX files in the repo

runs:
using: composite
steps:
- name: checkout source
uses: actions/checkout@v4

- name: Run chktex
uses: xu-cheng/texlive-action@v2
with:
scheme: full
run: |-
for file in *.tex; do \
echo $file; \
chktex $file | tee /dev/stderr | (! grep -q ^); \
done
13 changes: 13 additions & 0 deletions actions/latex/compile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# compile

This action can be used in the following manner:

```yaml
jobs:
compile-latex:
runs-on: ubuntu-latest
steps:
- uses: paddyroddy/.github/actions/latex/[email protected]
```
where `x.y.z` is the `major.minor.patch` version of the action.
14 changes: 14 additions & 0 deletions actions/latex/compile/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Compile LaTeX
description: Runs latexmk on the repo

runs:
using: composite
steps:
- name: checkout source
uses: actions/checkout@v4

- name: Build PDF
uses: xu-cheng/texlive-action@v2
with:
scheme: full
run: latexmk -quiet
24 changes: 24 additions & 0 deletions actions/latex/vale/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# vale

This action can be used in the following manner:

```yaml
jobs:
vale:
runs-on: ubuntu-latest
steps:
- uses: paddyroddy/.github/actions/latex/[email protected]
```
where `x.y.z` is the `major.minor.patch` version of the action. If flags are
required for vale, then modify the above to:

```yaml
jobs:
vale:
runs-on: ubuntu-latest
steps:
- uses: paddyroddy/.github/actions/latex/[email protected]
with:
vale-flags: ""
```
23 changes: 23 additions & 0 deletions actions/latex/vale/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Vale
description: Runs vale over all TeX files in the repo

inputs:
vale-flags:
description: Flags to pass to vale
default: ""

runs:
using: composite
steps:
- name: checkout source
uses: actions/checkout@v4

- name: Run Vale
uses: errata-ai/vale-action@v2
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
fail_on_error: true
filter_mode: nofilter
reporter: github-check
vale_flags: ${{ inputs.vale-flags }}

0 comments on commit 4061356

Please sign in to comment.