Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Check License
env:
EXPECTED_LICENSE_FILENAME: LICENSE
# SPDX identifier: https://spdx.org/licenses/
EXPECTED_LICENSE_TYPE: GPL-3.0
EXPECTED_LICENSE_TYPE: GPL-3.0

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
Expand Down
226 changes: 226 additions & 0 deletions .github/workflows/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
name: Check Prettier Formatting

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-prettier-formatting-task.yml"
- "Taskfile.yml"
- "**/.prettierignore"
- "**/.prettierrc*"
# CSS
- "**.css"
- "**.wxss"
# PostCSS
- "**.pcss"
- "**.postcss"
# Less
- "**.less"
# SCSS
- "**.scss"
# GraphQL
- "**.graphqls?"
- "**.gql"
# handlebars
- "**.handlebars"
- "**.hbs"
# HTML
- "**.mjml"
- "**.html?"
- "**.html.hl"
- "**.st"
- "**.xht"
- "**.xhtml"
# Vue
- "**.vue"
# JavaScript
- "**.flow"
- "**._?jsb?"
- "**.bones"
- "**.cjs"
- "**.es6?"
- "**.frag"
- "**.gs"
- "**.jake"
- "**.jscad"
- "**.jsfl"
- "**.js[ms]"
- "**.[mn]js"
- "**.pac"
- "**.wxs"
- "**.[xs]s?js"
- "**.xsjslib"
# JSX
- "**.jsx"
# TypeScript
- "**.ts"
# TSX
- "**.tsx"
# JSON
- "**/.eslintrc"
- "**.json"
- "**.avsc"
- "**.geojson"
- "**.gltf"
- "**.har"
- "**.ice"
- "**.JSON-tmLanguage"
- "**.mcmeta"
- "**.tfstate"
- "**.topojson"
- "**.webapp"
- "**.webmanifest"
- "**.yyp?"
# JSONC
- "**/.babelrc"
- "**/.jscsrc"
- "**/.js[hl]intrc"
- "**.jsonc"
- "**.sublime-*"
# JSON5
- "**.json5"
# Markdown
- "**.mdx?"
- "**.markdown"
- "**.mk?down"
- "**.mdwn"
- "**.mkdn?"
- "**.ronn"
- "**.workbook"
# YAML
- "**/.clang-format"
- "**/.clang-tidy"
- "**/.gemrc"
- "**/glide.lock"
- "**.yml"
- "**.mir"
- "**.reek"
- "**.rviz"
- "**.sublime-syntax"
- "**.syntax"
- "**.yaml"
- "**.yaml-tmlanguage"
- "**.yaml.sed"
- "**.yml.mysql"
pull_request:
paths:
- ".github/workflows/check-prettier-formatting-task.yml"
- "Taskfile.yml"
- "**/.prettierignore"
- "**/.prettierrc*"
# CSS
- "**.css"
- "**.wxss"
# PostCSS
- "**.pcss"
- "**.postcss"
# Less
- "**.less"
# SCSS
- "**.scss"
# GraphQL
- "**.graphqls?"
- "**.gql"
# handlebars
- "**.handlebars"
- "**.hbs"
# HTML
- "**.mjml"
- "**.html?"
- "**.html.hl"
- "**.st"
- "**.xht"
- "**.xhtml"
# Vue
- "**.vue"
# JavaScript
- "**.flow"
- "**._?jsb?"
- "**.bones"
- "**.cjs"
- "**.es6?"
- "**.frag"
- "**.gs"
- "**.jake"
- "**.jscad"
- "**.jsfl"
- "**.js[ms]"
- "**.[mn]js"
- "**.pac"
- "**.wxs"
- "**.[xs]s?js"
- "**.xsjslib"
# JSX
- "**.jsx"
# TypeScript
- "**.ts"
# TSX
- "**.tsx"
# JSON
- "**/.eslintrc"
- "**.json"
- "**.avsc"
- "**.geojson"
- "**.gltf"
- "**.har"
- "**.ice"
- "**.JSON-tmLanguage"
- "**.mcmeta"
- "**.tfstate"
- "**.topojson"
- "**.webapp"
- "**.webmanifest"
- "**.yyp?"
# JSONC
- "**/.babelrc"
- "**/.jscsrc"
- "**/.js[hl]intrc"
- "**.jsonc"
- "**.sublime-*"
# JSON5
- "**.json5"
# Markdown
- "**.mdx?"
- "**.markdown"
- "**.mk?down"
- "**.mdwn"
- "**.mkdn?"
- "**.ronn"
- "**.workbook"
# YAML
- "**/.clang-format"
- "**/.clang-tidy"
- "**/.gemrc"
- "**/glide.lock"
- "**.yml"
- "**.mir"
- "**.reek"
- "**.rviz"
- "**.sublime-syntax"
- "**.syntax"
- "**.yaml"
- "**.yaml-tmlanguage"
- "**.yaml.sed"
- "**.yml.mysql"
workflow_dispatch:
repository_dispatch:

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Taskfile
uses: arduino/actions/setup-taskfile@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Format with Prettier
run: task general:format

- name: Check formatting
run: git diff --color --exit-code
10 changes: 0 additions & 10 deletions .github/workflows/setup-taskflile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jobs:
operating-system: [ubuntu-latest, windows-latest]

steps:
# GitHub Actions has the annoying behavior of converting LF to CRLF when checking out on the Windows runner
- name: Disable EOL conversions
run: git config --global core.autocrlf false

- name: Checkout
uses: actions/checkout@master

Expand All @@ -31,12 +27,6 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install dependencies
run: task ts:install-deps

- name: npm lint
run: npm run format-check

- name: Run tests
run: task ts:test

Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/dist/
/lib/
/node_modules/
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Everything is now ready to make your contribution to the project, so commit it t
Thanks!

## Enable verbose logging for a pipeline

Additional log events with the prefix ::debug:: can be enabled by setting the secret `ACTIONS_STEP_DEBUG` to `true`.

See [step-debug-logs](https://github.com/actions/toolkit/blob/master/docs/action-debugging.md#step-debug-logs) for reference.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Check npm status](https://github.com/arduino/setup-task/actions/workflows/check-npm.yml/badge.svg)](https://github.com/arduino/setup-task/actions/workflows/check-npm.yml)
[![Integration Tests status](https://github.com/arduino/setup-task/actions/workflows/test-integration.yml/badge.svg)](https://github.com/arduino/setup-task/actions/workflows/test-integration.yml)
[![Check Action Metadata status](https://github.com/arduino/setup-task/actions/workflows/check-action-metadata-task.yml/badge.svg)](https://github.com/arduino/setup-task/actions/workflows/check-action-metadata-task.yml)
[![Check Prettier Formatting status](https://github.com/arduino/setup-task/actions/workflows/check-prettier-formatting-task.yml/badge.svg)](https://github.com/arduino/setup-task/actions/workflows/check-prettier-formatting-task.yml)
[![Check Markdown status](https://github.com/arduino/setup-task/actions/workflows/check-markdown-task.yml/badge.svg)](https://github.com/arduino/setup-task/actions/workflows/check-markdown-task.yml)
[![Spell Check status](https://github.com/arduino/setup-task/actions/workflows/spell-check-task.yml/badge.svg)](https://github.com/arduino/setup-task/actions/workflows/spell-check-task.yml)
[![Check License status](https://github.com/arduino/setup-task/actions/workflows/check-license.yml/badge.svg)](https://github.com/arduino/setup-task/actions/workflows/check-license.yml)
Expand Down Expand Up @@ -42,7 +43,7 @@ If you want to pin a major or minor version you can use the `.x` wildcard:
- name: Install Task
uses: arduino/setup-task@main
with:
version: '2.x'
version: 2.x
```

To pin the exact version:
Expand All @@ -51,7 +52,7 @@ To pin the exact version:
- name: Install Task
uses: arduino/setup-task@main
with:
version: '2.6.1'
version: 2.6.1
```

## Security
Expand Down
10 changes: 10 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ tasks:
deps:
- task: ts:build

format:
desc: Format all files
deps:
- task: general:format

check:
desc: Check for problems with the project
deps:
Expand Down Expand Up @@ -78,6 +83,11 @@ tasks:
done
exit $STATUS'

general:format:
desc: Format all supported files with Prettier
cmds:
- npx prettier --write .

general:check-spelling:
desc: Check for commonly misspelled words
cmds:
Expand Down
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: 'arduino/setup-task'
description: 'Download Task and add it to the PATH'
author: 'Arduino'
name: "arduino/setup-task"
description: "Download Task and add it to the PATH"
author: "Arduino"
inputs:
version:
description: 'Version to use. Example: 3.4.2'
description: "Version to use. Example: 3.4.2"
required: false
default: '3.x'
default: "3.x"
repo-token:
description: "Token with permissions to do repo things"
required: false

runs:
using: 'node12'
using: "node12"
main: "dist/index.js"
14 changes: 7 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
moduleFileExtensions: ["js", "ts"],
testEnvironment: "node",
testMatch: ["**/*.test.ts"],
testRunner: "jest-circus/runner",
transform: {
'^.+\\.ts$': 'ts-jest'
"^.+\\.ts$": "ts-jest",
},
verbose: true
}
verbose: true,
};
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
"private": true,
"description": "Setup Task action",
"main": "lib/main.js",
"scripts": {
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts"
},
"repository": {
"type": "git",
"url": "git+https://github.com/arduino/setup-task.git"
Expand Down
Loading