Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
teatimeguest committed Nov 12, 2021
0 parents commit 766a430
Show file tree
Hide file tree
Showing 21 changed files with 65,996 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--job test
--platform ubuntu-latest=nektos/act-environments-ubuntu:18.04-full
--rm
5 changes: 5 additions & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"Exclude": [
"^dist"
]
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
13 changes: 13 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root: true
env:
jest/globals: true
parser: '@typescript-eslint/parser'
plugins:
- jest
- '@typescript-eslint'
extends:
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:jest/recommended
- prettier
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist/** linguist-generated=true
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI

on:
push:
branches: '**'
pull_request:

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

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 12.x

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Lint
run: npm run lint

- name: Check format
run: |
npm run format-check
npm run editorconfig-checker
- name: Test
run: npm run test

- name: Upload coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}

check-dist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 12.x

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Check dist/
run: git diff --exit-code dist/

test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
version: ['2019', 'latest']
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install TeX Live
uses: ./
with:
version: ${{ matrix.version }}
cache: false

- name: Test
run: tlmgr --version
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/coverage
/lib
/node_modules
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parser: typescript
singleQuote: true
trailingComma: all
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2021 @teatimeguest

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# setup-texlive-action

[![Marketplace][marketplace-badge]][marketplace]
[![CI][ci-badge]][ci]
[![Codecov][codecov-badge]][codecov]

This action provides
the functionality of installing and caching [TeX Live][texlive].

Linux, Windows, and macOS are supported.

## Usage

Installing the latest version of TeX Live with `scheme-infraonly`:

```yaml
- name: Setup TeX Live
uses: teatimeguest/setup-texlive-action@v1

- name: Check `tlmgr` version
run: tlmgr --version
```
Additional TeX packages to be installed
can be specified by the `packages` input:

```yaml
- name: Setup TeX Live
uses: teatimeguest/setup-texlive-action@v1
with:
packages: >-
sheme-basic
cleveref
hyperref
```

An old version of TeX Live is also available:

```yaml
- name: Setup TeX Live 2019
uses: teatimeguest/setup-texlive-action@v1
with:
version: 2019
```

Versions prior to `2019` are currently not supported
as the `install-tl` script does not work properly on Windows and macOS.

## Caching

By default, the action caches `TEXDIR` using [`@actions/cache`][actions-cache]
to improve workflow execution time.
If you want to disable caching, you can use the `cache` input:

```yaml
- name: Setup TeX Live
uses: teatimeguest/setup-texlive-action@v1
with:
cache: false
```

## Inputs

All inputs are optional.

|Name|Type|Description|
|---|---|---|
|`cache`|Bool|Enable to cache `TEXDIR`. The default is `true`.|
|`packages`|String|Whitespace-separated list of TeX packages to install. Shemes and collections can also be specified.|
|`prefix`|String|TeX Live installation prefix. The default is `C:\TEMP\setup-texlive` on Windows, `/tmp/setup-texlive` on Linux and macOS.|
|`version`|String|Version of TeX Live to install. Supported values are `2019`, `2020`, `2021`, and `latest`.|

## Outputs

|Name|Type|Description|
|---|---|---|
|`cache-hit`|Bool|A boolean value to indicate if a cache was hit.|

## License

[MIT License](./LICENSE)

[marketplace]: https://github.com/marketplace/actions/setup-tex-live-action
[marketplace-badge]: https://img.shields.io/github/v/release/teatimeguest/setup-texlive-action?label=Marketplace&logo=github
[ci]: ../../actions/workflows/ci.yml
[ci-badge]: ../../actions/workflows/ci.yml/badge.svg?branch=main
[codecov]: https://codecov.io/gh/teatimeguest/setup-texlive-action
[codecov-badge]: https://codecov.io/gh/teatimeguest/setup-texlive-action/branch/main/graph/badge.svg?token=97878QAWCF
[texlive]: https://tug.org/texlive/
[actions-cache]: https://github.com/actions/toolkit/tree/main/packages/cache
Loading

0 comments on commit 766a430

Please sign in to comment.