2023-01-18 12:10:11 -08:00
|
|
|
name: Lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
rubocop:
|
|
|
|
name: Rubocop
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-12 02:58:59 -07:00
|
|
|
- uses: actions/checkout@v3.5.3
|
2023-02-22 12:17:35 -08:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2023-06-26 03:08:51 -07:00
|
|
|
uses: tj-actions/changed-files@v37
|
2023-02-22 12:17:35 -08:00
|
|
|
with:
|
|
|
|
files: "**/*.rb"
|
2023-02-12 07:41:18 -08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: sudo apt update && sudo apt-get install -y libpq-dev libxml2-dev libxslt1-dev libmagickwand-dev imagemagick libidn11-dev
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 12:10:11 -08:00
|
|
|
- name: Set up Ruby
|
|
|
|
uses: ruby/setup-ruby@v1
|
|
|
|
with:
|
|
|
|
bundler-cache: true
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 12:10:11 -08:00
|
|
|
- name: Run rubocop
|
|
|
|
uses: reviewdog/action-rubocop@v2
|
|
|
|
with:
|
|
|
|
rubocop_version: gemfile
|
|
|
|
rubocop_extensions: rubocop-rails:gemfile
|
|
|
|
reporter: github-pr-check
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 12:10:11 -08:00
|
|
|
|
|
|
|
eslint:
|
|
|
|
name: ESLint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-12 02:58:59 -07:00
|
|
|
- uses: actions/checkout@v3.5.3
|
2023-02-22 12:17:35 -08:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2023-06-26 03:08:51 -07:00
|
|
|
uses: tj-actions/changed-files@v37
|
2023-02-22 12:17:35 -08:00
|
|
|
with:
|
|
|
|
files: "**/*.ts"
|
2023-01-18 12:10:11 -08:00
|
|
|
- name: Set up Node 14
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: '14'
|
2023-01-20 21:56:40 -08:00
|
|
|
cache: 'yarn'
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 12:10:11 -08:00
|
|
|
- name: Install node modules
|
|
|
|
run: |
|
|
|
|
npm i -g yarn
|
|
|
|
yarn install --frozen-lockfile
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 12:10:11 -08:00
|
|
|
- uses: reviewdog/action-eslint@v1
|
|
|
|
with:
|
|
|
|
reporter: github-check
|
|
|
|
eslint_flags: '--ext .ts app/javascript'
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 12:10:11 -08:00
|
|
|
|
|
|
|
haml-lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-12 02:58:59 -07:00
|
|
|
- uses: actions/checkout@v3.5.3
|
2023-02-22 12:17:35 -08:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2023-06-26 03:08:51 -07:00
|
|
|
uses: tj-actions/changed-files@v37
|
2023-02-22 12:17:35 -08:00
|
|
|
with:
|
|
|
|
files: "**/*.haml"
|
2023-02-12 07:41:18 -08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: sudo apt update && sudo apt-get install -y libpq-dev libxml2-dev libxslt1-dev libmagickwand-dev imagemagick libidn11-dev
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 12:10:11 -08:00
|
|
|
- name: Set up Ruby
|
|
|
|
uses: ruby/setup-ruby@v1
|
|
|
|
with:
|
|
|
|
bundler-cache: true
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-06-26 03:08:46 -07:00
|
|
|
- uses: patch-technology/action-haml-lint@0.5
|
2023-01-18 12:10:11 -08:00
|
|
|
with:
|
|
|
|
reporter: github-check
|
|
|
|
rubocop_version: gemfile
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 13:10:39 -08:00
|
|
|
|
|
|
|
stylelint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-12 02:58:59 -07:00
|
|
|
- uses: actions/checkout@v3.5.3
|
2023-02-22 12:17:35 -08:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2023-06-26 03:08:51 -07:00
|
|
|
uses: tj-actions/changed-files@v37
|
2023-02-22 12:17:35 -08:00
|
|
|
with:
|
|
|
|
files: "**/*.scss"
|
2023-01-18 13:10:39 -08:00
|
|
|
- name: Set up Node 14
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: '14'
|
2023-01-20 21:56:40 -08:00
|
|
|
cache: 'yarn'
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 13:10:39 -08:00
|
|
|
- name: Install node modules
|
|
|
|
run: |
|
|
|
|
npm i -g yarn
|
|
|
|
yarn install --frozen-lockfile
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2023-01-18 13:10:39 -08:00
|
|
|
- name: stylelint
|
2023-06-26 03:08:40 -07:00
|
|
|
uses: reviewdog/action-stylelint@v1.17.1
|
2023-01-18 13:10:39 -08:00
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.github_token }}
|
|
|
|
reporter: github-pr-check
|
|
|
|
stylelint_input: 'app/assets/stylesheets/**/*.scss'
|
2023-02-22 12:17:35 -08:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|