From 99fd5c4e170e4dd53b5b6111d9bf588321224da3 Mon Sep 17 00:00:00 2001 From: Fabien Basmaison Date: Wed, 31 Mar 2021 17:59:52 +0200 Subject: [PATCH] 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. --- .github/workflows/linters-frontend.yaml | 21 ++++++++++----------- .github/workflows/linters-global.yaml | 6 +++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/linters-frontend.yaml b/.github/workflows/linters-frontend.yaml index 711f5d88b..978bbbbe5 100644 --- a/.github/workflows/linters-frontend.yaml +++ b/.github/workflows/linters-frontend.yaml @@ -1,30 +1,29 @@ # @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions -name: Frontend Linters +name: Lint Frontend on: push: branches: [ main, ci ] paths: + - '.github/workflows/**' - 'static/**' pull_request: branches: [ main, ci ] jobs: - linters: - name: linters + lint: + name: Lint with stylelint and ESLint. runs-on: ubuntu-20.04 steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - - name: stylelinter - uses: actions-hub/stylelint@v1.1.3 - env: - PATTERN: "*.css" + - name: Install modules + run: yarn + + - name: Run stylelint + run: yarn stylelint **/static/**/*.css --report-needless-disables --report-invalid-scope-disables - name: Run ESLint - uses: stefanoeb/eslint-action@1.0.2 - with: - files: - - 'bookwyrm/static/js/**' + run: yarn eslint . --ext .js,.jsx,.ts,.tsx diff --git a/.github/workflows/linters-global.yaml b/.github/workflows/linters-global.yaml index 291125c70..818939702 100644 --- a/.github/workflows/linters-global.yaml +++ b/.github/workflows/linters-global.yaml @@ -1,5 +1,5 @@ # @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions -name: Lint Project +name: Lint project globally on: push: @@ -8,8 +8,8 @@ on: branches: [ main, ci ] jobs: - linters: - name: linters + lint: + name: Lint with EditorConfig. runs-on: ubuntu-20.04 # Steps represent a sequence of tasks that will be executed as part of the job