discourse-solved/.github/workflows/plugin-linting.yml

49 lines
1.0 KiB
YAML
Raw Normal View History

name: Linting
2020-10-09 11:09:53 -04:00
on:
push:
branches:
- master
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
2020-10-09 11:09:53 -04:00
- uses: actions/checkout@v2
2020-10-09 11:09:53 -04:00
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12
2020-10-09 11:09:53 -04:00
- name: Set up ruby
uses: ruby/setup-ruby@v1
2020-10-09 11:09:53 -04:00
with:
ruby-version: 2.7
bundler-cache: true
2020-10-09 11:09:53 -04:00
- name: Yarn install
run: yarn install
2020-10-09 11:09:53 -04:00
- name: ESLint
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,assets}/javascripts
2020-10-09 11:09:53 -04:00
- name: Prettier
run: |
yarn prettier -v
2020-10-09 15:12:14 -04:00
if [ -d "assets" ]; then \
2020-10-12 04:16:56 -04:00
yarn prettier --list-different "assets/**/*.{scss,js,es6}" ; \
2020-10-09 15:12:14 -04:00
fi
if [ -d "test" ]; then \
yarn prettier --list-different "test/**/*.{js,es6}" ; \
fi
- name: Ember template lint
run: yarn ember-template-lint assets/javascripts
2020-10-09 11:09:53 -04:00
- name: Rubocop
run: bundle exec rubocop .