2020-09-25 14:06:55 -04:00
|
|
|
name: Linting
|
|
|
|
|
2020-10-09 11:09:41 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- main
|
|
|
|
pull_request:
|
2020-09-25 14:06:55 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-10-09 11:09:41 -04:00
|
|
|
- uses: actions/checkout@v2
|
2020-09-25 14:06:55 -04:00
|
|
|
|
2020-10-09 11:09:41 -04:00
|
|
|
- name: Set up Node.js
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12
|
2020-09-25 14:06:55 -04:00
|
|
|
|
2020-10-09 11:09:41 -04:00
|
|
|
- name: Set up ruby
|
|
|
|
uses: actions/setup-ruby@v1
|
|
|
|
with:
|
|
|
|
ruby-version: 2.7
|
2020-09-25 14:06:55 -04:00
|
|
|
|
2020-10-09 11:09:41 -04:00
|
|
|
- name: Setup bundler
|
|
|
|
run: gem install bundler -v 2.1.4 --no-doc
|
2020-09-25 14:06:55 -04:00
|
|
|
|
2020-10-09 11:09:41 -04:00
|
|
|
- name: Setup gems
|
|
|
|
run: bundle install --jobs 4
|
2020-09-25 14:06:55 -04:00
|
|
|
|
2020-10-09 11:09:41 -04:00
|
|
|
- name: Yarn install
|
|
|
|
run: yarn install --dev
|
2020-09-25 14:06:55 -04:00
|
|
|
|
2020-10-09 11:09:41 -04:00
|
|
|
- name: ESLint
|
|
|
|
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern assets/javascripts
|
2020-09-25 14:06:55 -04:00
|
|
|
|
2020-10-09 11:09:41 -04:00
|
|
|
- name: Prettier
|
|
|
|
run: |
|
|
|
|
yarn prettier -v
|
2020-10-09 15:03:16 -04:00
|
|
|
if [ -d "assets" ]; then \
|
2020-10-12 04:16:49 -04:00
|
|
|
yarn prettier --list-different "assets/**/*.{scss,js,es6}" ; \
|
2020-10-09 15:03:16 -04:00
|
|
|
fi
|
2020-09-25 14:06:55 -04:00
|
|
|
|
2020-10-09 11:09:41 -04:00
|
|
|
- name: Rubocop
|
|
|
|
run: bundle exec rubocop .
|