linters.yml 2.3 KB

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