Skip to content

Commit

Permalink
Merge actions-hlint-setup repo as /hlint-setup
Browse files Browse the repository at this point in the history
History context:
1. https://github.com/rwe/actions-hlint-setup
2. ndmitchell/hlint#1311
3. haskell#81
4. current merger of "unrelated repo histories", current branch
& further merge request
  • Loading branch information
Anton-Latukha committed Nov 12, 2021
2 parents f0ecab9 + 3cb653f commit 78eb8c5
Show file tree
Hide file tree
Showing 16 changed files with 6,086 additions and 0 deletions.
1 change: 1 addition & 0 deletions hlint-setup/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** generated linguist-vendored -diff
9 changes: 9 additions & 0 deletions hlint-setup/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `root` directory
directory: "/"
# Check the npm registry for updates every day (weekdays)
schedule:
interval: "daily"
26 changes: 26 additions & 0 deletions hlint-setup/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: test
on:
pull_request:
push:
branches:
- master
- 'releases/*'

jobs:
# unit tests
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn test

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn compile
- run: yarn package
- uses: ./
- run: hlint --version
31 changes: 31 additions & 0 deletions hlint-setup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
node_modules/

# Editors
.vscode/
.idea/
*.iml

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Yarn Integrity file
.yarn-integrity
1 change: 1 addition & 0 deletions hlint-setup/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/erbium
21 changes: 21 additions & 0 deletions hlint-setup/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Robert Estelle

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.
48 changes: 48 additions & 0 deletions hlint-setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# rwe/actions-hlint-setup

GitHub Action: Set up hlint

Downloads and a binary HLint release from [@ndmitchell/hlint](https://github.com/ndmitchell/hlint).

The release is cached using [@actions/tool-cache](https://github.com/actions/tool-cache) and is added to `PATH`.

See also [rwe/actions-hlint-run](https://github.com/rwe/actions-hlint-run), which will run hlint and format its output for GitHub annotations.

## Inputs

* `version`: The HLint version to download. Defaults to `3.1.6`.

## Outputs

* `hlint-dir`: Resulting directory containing the hlint executable
* `hlint-bin`: Location of the hlint executable
* `version`: Version of the hlint tool (same as input, if provided)

## Example

```yaml
name: lint
on:
pull_request:
push:
branches:
- master
- 'releases/*'

jobs:
hlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: 'Set up HLint'
uses: rwe/actions-hlint-setup@v1
with:
version: '3.1.6'

- name: 'Run HLint'
uses: rwe/actions-hlint-run@v1
with:
path: src/
fail-on: warning
```
20 changes: 20 additions & 0 deletions hlint-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Set up HLint'
description: 'Cached download of hlint binary release'
inputs:
version:
description: 'hlint version'
required: true
default: '3.1.6'
outputs:
hlint-dir:
description: 'Directory containing the hlint executable'
hlint-bin:
description: 'Location of the hlint executable'
version:
description: 'Version of the hlint tool (same as input, if provided)'
runs:
using: 'node12'
main: 'dist/index.js'
branding:
icon: 'arrow-down-circle'
color: blue
Loading

0 comments on commit 78eb8c5

Please sign in to comment.