lint.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. executor:
  2. name: linux-docker
  3. size: medium
  4. steps:
  5. - checkout:
  6. path: src/electron
  7. - run:
  8. name: Setup third_party Depot Tools
  9. command: |
  10. # "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
  11. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
  12. echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV
  13. - run:
  14. name: Download GN Binary
  15. command: |
  16. chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
  17. gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
  18. cipd ensure -ensure-file - -root . \<<-CIPD
  19. \$ServiceURL https://chrome-infra-packages.appspot.com/
  20. @Subdir src/buildtools/linux64
  21. gn/gn/linux-amd64 $gn_version
  22. CIPD
  23. echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
  24. - run:
  25. name: Download clang-format Binary
  26. command: |
  27. chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
  28. sha1_path='buildtools/linux64/clang-format.sha1'
  29. curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/${sha1_path}?format=TEXT" | base64 -d > "src/${sha1_path}"
  30. download_from_google_storage.py --no_resume --no_auth --bucket chromium-clang-format -s "src/${sha1_path}"
  31. - run:
  32. name: Run Lint
  33. command: |
  34. # gn.py tries to find a gclient root folder starting from the current dir.
  35. # When it fails and returns "None" path, the whole script fails. Let's "fix" it.
  36. touch .gclient
  37. # Another option would be to checkout "buildtools" inside the Electron checkout,
  38. # but then we would lint its contents (at least gn format), and it doesn't pass it.
  39. cd src/electron
  40. node script/yarn install --frozen-lockfile
  41. node script/yarn lint
  42. - run:
  43. name: Run Script Typechecker
  44. command: |
  45. cd src/electron
  46. node script/yarn tsc -p tsconfig.script.json