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-09-25 02:37:54 -07:00
|
|
|
- uses: actions/checkout@v4.1.0
|
2023-02-22 12:17:35 -08:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2023-09-13 13:53:22 -07:00
|
|
|
uses: tj-actions/changed-files@v39
|
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-09-25 02:37:54 -07:00
|
|
|
- uses: actions/checkout@v4.1.0
|
2023-02-22 12:17:35 -08:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2023-09-13 13:53:22 -07:00
|
|
|
uses: tj-actions/changed-files@v39
|
2023-02-22 12:17:35 -08:00
|
|
|
with:
|
|
|
|
files: "**/*.ts"
|
2023-10-15 04:13:52 -07:00
|
|
|
- name: Set up Node 16
|
2023-01-18 12:10:11 -08:00
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-10-15 04:13:52 -07:00
|
|
|
node-version: '16'
|
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-09-25 02:37:54 -07:00
|
|
|
- uses: actions/checkout@v4.1.0
|
2023-02-22 12:17:35 -08:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2023-09-13 13:53:22 -07:00
|
|
|
uses: tj-actions/changed-files@v39
|
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-09-25 02:37:54 -07:00
|
|
|
- uses: actions/checkout@v4.1.0
|
2023-02-22 12:17:35 -08:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2023-09-13 13:53:22 -07:00
|
|
|
uses: tj-actions/changed-files@v39
|
2023-02-22 12:17:35 -08:00
|
|
|
with:
|
|
|
|
files: "**/*.scss"
|
2023-10-15 04:13:52 -07:00
|
|
|
- name: Set up Node 16
|
2023-01-18 13:10:39 -08:00
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-10-15 04:13:52 -07:00
|
|
|
node-version: '16'
|
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-09-11 02:08:15 -07:00
|
|
|
uses: reviewdog/action-stylelint@v1.18.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'
|