Tweak Github Actions:

- Rename some jobs for consistency.
- Add workflows path to trigger lint when updating workflows.
- Simplify frontend actions to speed up process and reduce dependencies.
This commit is contained in:
Fabien Basmaison 2021-03-31 17:59:52 +02:00
parent 53f03457cc
commit 99fd5c4e17
2 changed files with 13 additions and 14 deletions

View file

@ -1,30 +1,29 @@
# @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions # @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Frontend Linters name: Lint Frontend
on: on:
push: push:
branches: [ main, ci ] branches: [ main, ci ]
paths: paths:
- '.github/workflows/**'
- 'static/**' - 'static/**'
pull_request: pull_request:
branches: [ main, ci ] branches: [ main, ci ]
jobs: jobs:
linters: lint:
name: linters name: Lint with stylelint and ESLint.
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: stylelinter - name: Install modules
uses: actions-hub/stylelint@v1.1.3 run: yarn
env:
PATTERN: "*.css" - name: Run stylelint
run: yarn stylelint **/static/**/*.css --report-needless-disables --report-invalid-scope-disables
- name: Run ESLint - name: Run ESLint
uses: stefanoeb/eslint-action@1.0.2 run: yarn eslint . --ext .js,.jsx,.ts,.tsx
with:
files:
- 'bookwyrm/static/js/**'

View file

@ -1,5 +1,5 @@
# @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions # @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Lint Project name: Lint project globally
on: on:
push: push:
@ -8,8 +8,8 @@ on:
branches: [ main, ci ] branches: [ main, ci ]
jobs: jobs:
linters: lint:
name: linters name: Lint with EditorConfig.
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job # Steps represent a sequence of tasks that will be executed as part of the job