linters.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. SKIP_YARN_COREPACK_CHECK: true
  19. jobs:
  20. lint_js:
  21. name: Lint JavaScript/TypeScript
  22. runs-on: ubuntu-latest
  23. steps:
  24. - name: Checkout sources
  25. uses: actions/checkout@v4
  26. - name: Install Node.js
  27. uses: actions/setup-node@v4
  28. with:
  29. node-version: lts/*
  30. cache: yarn
  31. - name: Install dependencies
  32. # List all projects that use a custom ESLint config:
  33. run:
  34. corepack yarn workspaces focus @uppy/angular @uppy-example/angular
  35. @uppy-example/react-native-expo @uppy/react-native @uppy-dev/build
  36. - name: Run linter
  37. run: corepack yarn run lint
  38. - name: Run Prettier
  39. run: corepack yarn run format:check-diff
  40. lint_md:
  41. name: Lint Markdown
  42. runs-on: ubuntu-latest
  43. steps:
  44. - name: Checkout sources
  45. uses: actions/checkout@v4
  46. - name: Install Node.js
  47. uses: actions/setup-node@v4
  48. with:
  49. node-version: lts/*
  50. cache: yarn
  51. - name: Install dependencies
  52. run: corepack yarn workspaces focus @uppy-dev/build
  53. - name: Run linter
  54. run: corepack yarn run lint:markdown
  55. lint_docs:
  56. name: Lint Docs
  57. runs-on: ubuntu-latest
  58. steps:
  59. - name: Checkout Uppy.io sources
  60. uses: actions/checkout@v4
  61. with:
  62. repository: transloadit/uppy.io
  63. - run: rm -rf docs # the other PR has not landed
  64. - name: Checkout docs
  65. uses: actions/checkout@v4
  66. with:
  67. path: uppy
  68. - run: mv uppy /tmp/uppy && ln -s /tmp/uppy/docs docs
  69. - name: Install dependencies
  70. run: corepack yarn --immutable
  71. - name: Lint files
  72. run: corepack yarn lint
  73. - name: Test build website
  74. run: corepack yarn build