2021-03-31 14:15:30 +00:00
|
|
|
# @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
2021-03-31 15:59:52 +00:00
|
|
|
name: Lint Frontend
|
2021-03-31 14:15:30 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-04-05 14:35:09 +00:00
|
|
|
branches: [ main, ci, frontend ]
|
2021-03-31 14:15:30 +00:00
|
|
|
paths:
|
2021-03-31 15:59:52 +00:00
|
|
|
- '.github/workflows/**'
|
2021-03-31 14:15:30 +00:00
|
|
|
- 'static/**'
|
2021-04-05 14:35:09 +00:00
|
|
|
- '.eslintrc'
|
|
|
|
- '.stylelintrc'
|
2021-03-31 14:15:30 +00:00
|
|
|
pull_request:
|
2021-04-05 14:35:09 +00:00
|
|
|
branches: [ main, ci, frontend ]
|
2021-03-31 14:15:30 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-03-31 15:59:52 +00:00
|
|
|
lint:
|
|
|
|
name: Lint with stylelint and ESLint.
|
2021-03-31 14:15:30 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
|
|
|
steps:
|
2021-04-17 10:39:57 +00:00
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
|
2021-03-31 14:15:30 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-03-31 15:59:52 +00:00
|
|
|
- name: Install modules
|
|
|
|
run: yarn
|
|
|
|
|
2021-04-05 14:17:11 +00:00
|
|
|
# See .stylelintignore for files that are not linted.
|
2021-03-31 15:59:52 +00:00
|
|
|
- name: Run stylelint
|
2021-04-17 10:39:57 +00:00
|
|
|
run: >
|
|
|
|
yarn stylelint bookwyrm/static/**/*.css \
|
|
|
|
--report-needless-disables \
|
|
|
|
--report-invalid-scope-disables
|
2021-03-31 15:07:28 +00:00
|
|
|
|
2021-04-05 14:17:11 +00:00
|
|
|
# See .eslintignore for files that are not linted.
|
2021-03-31 15:07:28 +00:00
|
|
|
- name: Run ESLint
|
2021-04-17 10:39:57 +00:00
|
|
|
run: >
|
|
|
|
yarn eslint bookwyrm/static \
|
|
|
|
--ext .js,.jsx,.ts,.tsx
|