2022-06-18 15:27:31 -04:00
|
|
|
name: Linting
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: plugin-linting-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2022-11-07 15:14:16 -05:00
|
|
|
node-version: 18
|
2022-06-18 15:27:31 -04:00
|
|
|
cache: yarn
|
|
|
|
|
|
|
|
- name: Yarn install
|
|
|
|
run: yarn install
|
|
|
|
|
|
|
|
- name: ESLint
|
2022-11-07 15:14:16 -05:00
|
|
|
if: ${{ !cancelled() }}
|
2022-06-18 15:27:31 -04:00
|
|
|
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,javascripts}
|
|
|
|
|
|
|
|
- name: Prettier
|
2022-11-07 15:14:16 -05:00
|
|
|
if: ${{ !cancelled() }}
|
2022-06-18 15:27:31 -04:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
yarn prettier -v
|
|
|
|
files=$(find javascripts desktop mobile common scss -type f \( -name "*.scss" -or -name "*.js" -or -name "*.es6" \) 2> /dev/null) || true
|
|
|
|
if [ -n "$files" ]; then
|
|
|
|
yarn prettier --list-different $files
|
|
|
|
fi
|
|
|
|
if [ 0 -lt $(find test -type f \( -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then
|
|
|
|
yarn prettier --list-different "test/**/*.{js,es6}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Ember template lint
|
2022-11-07 15:14:16 -05:00
|
|
|
if: ${{ !cancelled() }}
|
2022-06-18 15:27:31 -04:00
|
|
|
run: yarn ember-template-lint --no-error-on-unmatched-pattern javascripts
|