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

54 lines
1.3 KiB
YAML
Raw Normal View History

2020-11-02 12:57:36 -05:00
name: Linting
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
2020-11-02 12:57:36 -05:00
with:
node-version: 16
cache: yarn
- name: Yarn install
run: yarn install
2020-11-02 12:57:36 -05:00
- name: Set up ruby
uses: ruby/setup-ruby@v1
2020-11-02 12:57:36 -05:00
with:
ruby-version: 2.7
bundler-cache: true
2020-11-02 12:57:36 -05:00
- name: ESLint
if: ${{ always() }}
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,assets}/javascripts
2020-11-02 12:57:36 -05:00
- name: Prettier
if: ${{ always() }}
shell: bash
2020-11-02 12:57:36 -05:00
run: |
yarn prettier -v
if [ 0 -lt $(find assets -type f \( -name "*.scss" -or -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then
yarn prettier --list-different "assets/**/*.{scss,js,es6}"
2020-11-02 12:57:36 -05:00
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
2020-11-02 12:57:36 -05:00
- name: Ember template lint
if: ${{ always() }}
run: yarn ember-template-lint assets/javascripts
2020-11-02 12:57:36 -05:00
- name: Rubocop
if: ${{ always() }}
2020-11-02 12:57:36 -05:00
run: bundle exec rubocop .