You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.4 KiB

  1. ---
  2. #################################
  3. #################################
  4. ## Super Linter GitHub Actions ##
  5. #################################
  6. #################################
  7. name: Lint Code Base
  8. #
  9. # Documentation:
  10. # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
  11. #
  12. #############################
  13. # Start the job on all push #
  14. #############################
  15. on:
  16. push:
  17. branches-ignore: [main]
  18. # Remove the line above to run when pushing to master
  19. pull_request:
  20. branches: [main]
  21. ###############
  22. # Set the Job #
  23. ###############
  24. permissions:
  25. checks: write
  26. contents: read
  27. pull-requests: write
  28. statuses: write
  29. jobs:
  30. build:
  31. # Name the Job
  32. name: Lint Code Base
  33. # Set the agent to run on
  34. runs-on: ubuntu-latest
  35. ##################
  36. # Load all steps #
  37. ##################
  38. steps:
  39. ##########################
  40. # Checkout the code base #
  41. ##########################
  42. - name: Checkout Code
  43. uses: actions/checkout@v3
  44. with:
  45. # Full git history is needed to get a proper list of changed files within `super-linter`
  46. fetch-depth: 0
  47. - name: Set-up Node.js
  48. uses: actions/setup-node@v3
  49. with:
  50. node-version: 16.x
  51. cache: yarn
  52. - name: Install dependencies
  53. run: yarn install --frozen-lockfile
  54. - name: Check prettier formatting
  55. run: yarn format-check
  56. - name: Set-up RuboCop Problem Mathcher
  57. uses: r7kamura/rubocop-problem-matchers-action@v1
  58. - name: Set-up Stylelint Problem Matcher
  59. uses: xt0rted/stylelint-problem-matcher@v1
  60. # https://github.com/xt0rted/stylelint-problem-matcher/issues/360
  61. - run: echo "::add-matcher::.github/stylelint-matcher.json"
  62. ################################
  63. # Run Linter against code base #
  64. ################################
  65. - name: Lint Code Base
  66. uses: github/super-linter@v4
  67. env:
  68. CSS_FILE_NAME: stylelint.config.js
  69. DEFAULT_BRANCH: main
  70. NO_COLOR: 1 # https://github.com/xt0rted/stylelint-problem-matcher/issues/360
  71. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  72. JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.js
  73. LINTER_RULES_PATH: .
  74. RUBY_CONFIG_FILE: .rubocop.yml
  75. VALIDATE_ALL_CODEBASE: false
  76. VALIDATE_CSS: true
  77. VALIDATE_JAVASCRIPT_ES: true
  78. VALIDATE_RUBY: true