lint.yml 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. pool:
  2. vmImage: 'Ubuntu 16.04'
  3. steps:
  4. - bash: |
  5. # "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
  6. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git "${AGENT_BUILDDIRECTORY}/third_party/depot_tools"
  7. echo "##vso[task.setvariable variable=PATH]$PATH:${AGENT_BUILDDIRECTORY}/third_party/depot_tools"
  8. displayName: Setup Depot Tools
  9. - bash: |
  10. chromium_revision="$(grep -A1 chromium_version DEPS | tr -d '\n' | cut -d\' -f4)"
  11. buildtools_revision="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep buildtools_revision -A1 | tr -d '\n' | cut -d\' -f4)"
  12. git clone https://chromium.googlesource.com/chromium/buildtools "${AGENT_TEMPDIRECTORY}/buildtools"
  13. (cd "${AGENT_TEMPDIRECTORY}/buildtools" && git checkout "$buildtools_revision")
  14. echo "##vso[task.setvariable variable=CHROMIUM_BUILDTOOLS_PATH]$AGENT_TEMPDIRECTORY/buildtools"
  15. download_from_google_storage --bucket chromium-gn -s "${AGENT_TEMPDIRECTORY}/buildtools/linux64/gn.sha1"
  16. displayName: Download gn binary
  17. - bash: |
  18. # gn.py tries to find a gclient root folder starting from the current dir.
  19. # When it fails and returns "None" path, the whole script fails. Let's "fix" it.
  20. touch .gclient
  21. # Another option would be to checkout "buildtools" inside the Electron checkout,
  22. # but then we would lint its contents (at least gn format), and it doesn't pass it.
  23. npm install
  24. npm run lint
  25. displayName: Run Lint