linters.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. jobs:
  15. lint_js:
  16. name: Lint JavaScript/TypeScript
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Checkout sources
  20. uses: actions/checkout@v3
  21. - name: Get yarn cache directory path
  22. id: yarn-cache-dir-path
  23. run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
  24. - uses: actions/cache@v3
  25. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  26. with:
  27. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  28. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  29. restore-keys: |
  30. ${{ runner.os }}-yarn-
  31. - name: Install Node.js
  32. uses: actions/setup-node@v3
  33. with:
  34. node-version: lts/*
  35. - name: Install dependencies
  36. # List all projects that use a custom ESLint config:
  37. run: corepack yarn workspaces focus @uppy/angular @uppy-example/angular @uppy-example/react-native-expo @uppy/react-native @uppy-dev/build
  38. - name: Run linter
  39. run: corepack yarn run lint
  40. lint_md:
  41. name: Lint Markdown
  42. runs-on: ubuntu-latest
  43. steps:
  44. - name: Checkout sources
  45. uses: actions/checkout@v3
  46. - name: Get yarn cache directory path
  47. id: yarn-cache-dir-path
  48. run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
  49. - uses: actions/cache@v3
  50. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  51. with:
  52. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  53. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  54. restore-keys: |
  55. ${{ runner.os }}-yarn-
  56. - name: Install Node.js
  57. uses: actions/setup-node@v3
  58. with:
  59. node-version: lts/*
  60. - name: Install dependencies
  61. run: corepack yarn workspaces focus @uppy-dev/build
  62. - name: Run linter
  63. run: corepack yarn run lint:markdown