linters.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. name: Linters
  2. on:
  3. push:
  4. branches: [ main ]
  5. paths-ignore:
  6. - '.github/**'
  7. - '!.github/workflows/linters.yml'
  8. - '!.github/CONTRIBUTING.md'
  9. pull_request:
  10. # We want all branches so we configure types to be the GH default again
  11. types: [ opened, synchronize, reopened ]
  12. paths-ignore:
  13. - '.github/**'
  14. - '!.github/workflows/linters.yml'
  15. - '!.github/CONTRIBUTING.md'
  16. env:
  17. YARN_ENABLE_GLOBAL_CACHE: false
  18. jobs:
  19. lint_js:
  20. name: Lint JavaScript/TypeScript
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: Checkout sources
  24. uses: actions/checkout@v3
  25. - name: Get yarn cache directory path
  26. id: yarn-cache-dir-path
  27. run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
  28. - uses: actions/cache@v3
  29. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  30. with:
  31. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  32. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  33. restore-keys: |
  34. ${{ runner.os }}-yarn-
  35. - name: Install Node.js
  36. uses: actions/setup-node@v3
  37. with:
  38. node-version: lts/*
  39. - name: Install dependencies
  40. # List all projects that use a custom ESLint config:
  41. run: corepack yarn workspaces focus @uppy/angular @uppy-example/angular @uppy-example/react-native-expo @uppy/react-native @uppy-dev/build
  42. - name: Run linter
  43. run: corepack yarn run lint
  44. lint_md:
  45. name: Lint Markdown
  46. runs-on: ubuntu-latest
  47. steps:
  48. - name: Checkout sources
  49. uses: actions/checkout@v3
  50. - name: Get yarn cache directory path
  51. id: yarn-cache-dir-path
  52. run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
  53. - uses: actions/cache@v3
  54. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  55. with:
  56. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  57. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  58. restore-keys: |
  59. ${{ runner.os }}-yarn-
  60. - name: Install Node.js
  61. uses: actions/setup-node@v3
  62. with:
  63. node-version: lts/*
  64. - name: Install dependencies
  65. run: corepack yarn workspaces focus @uppy-dev/build
  66. - name: Run linter
  67. run: corepack yarn run lint:markdown