2020-09-25 12:22:29 -04:00
|
|
|
name: Linting
|
|
|
|
|
2020-10-09 11:09:53 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
2020-09-25 12:22:29 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-10-09 11:09:53 -04:00
|
|
|
- uses: actions/checkout@v2
|
2020-09-25 12:22:29 -04:00
|
|
|
|
2020-10-09 11:09:53 -04:00
|
|
|
- name: Set up Node.js
|
2021-12-16 13:05:49 -05:00
|
|
|
uses: actions/setup-node@v2
|
2020-10-09 11:09:53 -04:00
|
|
|
with:
|
2021-12-16 13:05:49 -05:00
|
|
|
node-version: 16
|
|
|
|
cache: yarn
|
|
|
|
|
|
|
|
- name: Yarn install
|
|
|
|
run: yarn install
|
2020-09-25 12:22:29 -04:00
|
|
|
|
2020-10-09 11:09:53 -04:00
|
|
|
- name: Set up ruby
|
2021-04-27 06:13:19 -04:00
|
|
|
uses: ruby/setup-ruby@v1
|
2020-10-09 11:09:53 -04:00
|
|
|
with:
|
|
|
|
ruby-version: 2.7
|
2021-04-27 06:13:19 -04:00
|
|
|
bundler-cache: true
|
2020-09-25 12:22:29 -04:00
|
|
|
|
2020-10-09 11:09:53 -04:00
|
|
|
- name: ESLint
|
2021-07-02 10:33:32 -04:00
|
|
|
if: ${{ always() }}
|
2021-04-27 06:13:19 -04:00
|
|
|
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,assets}/javascripts
|
2020-09-25 12:22:29 -04:00
|
|
|
|
2020-10-09 11:09:53 -04:00
|
|
|
- name: Prettier
|
2021-07-02 10:33:32 -04:00
|
|
|
if: ${{ always() }}
|
|
|
|
shell: bash
|
2020-10-09 11:09:53 -04:00
|
|
|
run: |
|
|
|
|
yarn prettier -v
|
2021-09-15 14:02:05 -04:00
|
|
|
if [ 0 -lt $(find assets -type f \( -name "*.scss" -or -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then
|
2021-07-02 10:33:32 -04:00
|
|
|
yarn prettier --list-different "assets/**/*.{scss,js,es6}"
|
2020-10-09 15:12:14 -04:00
|
|
|
fi
|
2021-09-15 14:02:05 -04:00
|
|
|
if [ 0 -lt $(find test -type f \( -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then
|
2021-07-02 10:33:32 -04:00
|
|
|
yarn prettier --list-different "test/**/*.{js,es6}"
|
2021-04-27 06:13:19 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Ember template lint
|
2021-07-02 10:33:32 -04:00
|
|
|
if: ${{ always() }}
|
2021-04-27 06:13:19 -04:00
|
|
|
run: yarn ember-template-lint assets/javascripts
|
2020-09-25 12:22:29 -04:00
|
|
|
|
2020-10-09 11:09:53 -04:00
|
|
|
- name: Rubocop
|
2021-07-02 10:33:32 -04:00
|
|
|
if: ${{ always() }}
|
2020-10-09 11:09:53 -04:00
|
|
|
run: bundle exec rubocop .
|