Files
grecia/.github/workflows/linters.yml
Javi Martín df37ce69ab Check markdown rules in github actions
This way we'll notice syntax inconsistencies in pull requests. We
weren't doing it until now because there's no Pronto runner for MDL and
we weren't running linters individually.

Note we aren't checking the templates in the `.github` folders, since
these templates don't have a top level header in the beginning (they'll
be displayed on a page which already has a top level header) and MDL
doesn't provide a way to ignore certain rules on certain files. So we're
specifying which files to include instead of running `mdl .` (which
would also include the `node_modules` folder) or running `mdl -g .`
(which would exclude the `node_modules` folder but would include the
`.github` folder).
2024-06-21 16:46:51 +02:00

43 lines
1.1 KiB
YAML

name: linters
on: [pull_request]
permissions:
contents: read
jobs:
linters:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: RuboCop
run: bundle exec rubocop --fail-level convention --display-only-fail-level-offenses -f github
- name: ERB Lint
run: bundle exec erblint .
- name: ESLint
run: npx eslint . --quiet
- name: Stylelint
run: npx stylelint app/assets/stylesheets
- name: Markdownlint
run: bundle exec mdl *.md docs/
name: ${{ matrix.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- run: |
git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/*
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup NPM
uses: actions/setup-node@v4
with:
cache: "npm"
node-version-file: ".node-version"
- name: Install node packages
run: npm clean-install
- name: ${{ matrix.name }}
run: ${{ matrix.run }}