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

55 lines
1.2 KiB
YAML
Raw Normal View History

2021-04-02 18:53:34 -04:00
name: Linting
on:
push:
branches:
- master
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Yarn install
run: yarn install
- name: ESLint
if: ${{ always() }}
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,assets}/javascripts
- name: Prettier
if: ${{ always() }}
2021-04-07 10:41:13 -04:00
shell: bash
2021-04-02 18:53:34 -04:00
run: |
yarn prettier -v
shopt -s extglob
2021-04-07 10:41:13 -04:00
if ls assets/**/*.@(scss|js|es6) &> /dev/null; then
yarn prettier --list-different "assets/**/*.{scss,js,es6}"
2021-04-02 18:53:34 -04:00
fi
2021-04-07 10:41:13 -04:00
if ls test/**/*.@(js|es6) &> /dev/null; then
yarn prettier --list-different "test/**/*.{js,es6}"
2021-04-02 18:53:34 -04:00
fi
- name: Ember template lint
if: ${{ always() }}
run: yarn ember-template-lint assets/javascripts
- name: Rubocop
if: ${{ always() }}
run: bundle exec rubocop .