2019-09-17 21:48:02 +03:00
|
|
|
version: 2.1
|
|
|
|
|
2021-11-30 02:09:07 +03:00
|
|
|
# Required for dynamic configuration
|
|
|
|
setup: true
|
|
|
|
|
|
|
|
# Orbs
|
|
|
|
orbs:
|
|
|
|
path-filtering: circleci/path-filtering@0.1.0
|
|
|
|
|
|
|
|
# All input parameters to pass to build config
|
2019-09-17 21:48:02 +03:00
|
|
|
parameters:
|
2021-11-30 02:09:07 +03:00
|
|
|
run-docs-only:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
|
2019-09-17 21:48:02 +03:00
|
|
|
upload-to-s3:
|
|
|
|
type: string
|
|
|
|
default: '1'
|
2019-10-09 00:46:01 +03:00
|
|
|
|
2019-09-17 21:48:02 +03:00
|
|
|
run-build-linux:
|
|
|
|
type: boolean
|
2021-11-30 02:09:07 +03:00
|
|
|
default: false
|
2019-09-17 21:48:02 +03:00
|
|
|
|
|
|
|
run-build-mac:
|
|
|
|
type: boolean
|
2021-11-30 02:09:07 +03:00
|
|
|
default: false
|
2019-09-17 21:48:02 +03:00
|
|
|
|
2020-02-11 23:42:37 +03:00
|
|
|
run-linux-publish:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
|
2021-06-07 17:17:27 +03:00
|
|
|
linux-publish-arch-limit:
|
|
|
|
type: enum
|
|
|
|
default: all
|
|
|
|
enum: ["all", "arm", "arm64", "x64", "ia32"]
|
|
|
|
|
2020-02-11 23:42:37 +03:00
|
|
|
run-macos-publish:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
|
2021-06-07 17:17:27 +03:00
|
|
|
macos-publish-arch-limit:
|
|
|
|
type: enum
|
|
|
|
default: all
|
|
|
|
enum: ["all", "osx-x64", "osx-arm64", "mas-x64", "mas-arm64"]
|
|
|
|
|
2021-11-30 02:09:07 +03:00
|
|
|
# Envs
|
|
|
|
env-global: &env-global
|
|
|
|
ELECTRON_OUT_DIR: Default
|
|
|
|
|
|
|
|
env-linux-medium: &env-linux-medium
|
|
|
|
<<: *env-global
|
|
|
|
NUMBER_OF_NINJA_PROCESSES: 3
|
|
|
|
|
2021-05-10 11:18:59 +03:00
|
|
|
# Executors
|
|
|
|
executors:
|
|
|
|
linux-docker:
|
|
|
|
parameters:
|
|
|
|
size:
|
|
|
|
description: "Docker executor size"
|
|
|
|
default: 2xlarge+
|
|
|
|
type: enum
|
|
|
|
enum: ["medium", "xlarge", "2xlarge+"]
|
|
|
|
docker:
|
2021-08-16 20:33:49 +03:00
|
|
|
- image: ghcr.io/electron/build:27db4a3e3512bfd2e47f58cea69922da0835f1d9
|
2021-05-10 11:18:59 +03:00
|
|
|
resource_class: << parameters.size >>
|
|
|
|
|
2021-11-30 02:09:07 +03:00
|
|
|
# List of always run steps
|
2018-09-17 19:44:02 +03:00
|
|
|
step-checkout-electron: &step-checkout-electron
|
|
|
|
checkout:
|
|
|
|
path: src/electron
|
|
|
|
|
2019-02-06 23:53:25 +03:00
|
|
|
steps-lint: &steps-lint
|
|
|
|
steps:
|
|
|
|
- *step-checkout-electron
|
|
|
|
- run:
|
|
|
|
name: Setup third_party Depot Tools
|
|
|
|
command: |
|
|
|
|
# "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
|
|
|
|
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
|
|
|
|
echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV
|
|
|
|
- run:
|
|
|
|
name: Download GN Binary
|
|
|
|
command: |
|
|
|
|
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
|
2019-03-22 02:35:29 +03:00
|
|
|
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)"
|
2019-02-06 23:53:25 +03:00
|
|
|
|
2019-09-17 21:48:02 +03:00
|
|
|
cipd ensure -ensure-file - -root . \<<-CIPD
|
2019-07-25 20:44:28 +03:00
|
|
|
\$ServiceURL https://chrome-infra-packages.appspot.com/
|
|
|
|
@Subdir src/buildtools/linux64
|
|
|
|
gn/gn/linux-amd64 $gn_version
|
|
|
|
CIPD
|
2019-02-06 23:53:25 +03:00
|
|
|
|
2019-07-09 11:40:26 +03:00
|
|
|
echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
|
|
|
|
- run:
|
|
|
|
name: Download clang-format Binary
|
|
|
|
command: |
|
|
|
|
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
|
|
|
|
|
|
|
|
sha1_path='buildtools/linux64/clang-format.sha1'
|
|
|
|
curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/${sha1_path}?format=TEXT" | base64 -d > "src/${sha1_path}"
|
|
|
|
|
|
|
|
download_from_google_storage.py --no_resume --no_auth --bucket chromium-clang-format -s "src/${sha1_path}"
|
2019-02-06 23:53:25 +03:00
|
|
|
- run:
|
|
|
|
name: Run Lint
|
|
|
|
command: |
|
|
|
|
# gn.py tries to find a gclient root folder starting from the current dir.
|
|
|
|
# When it fails and returns "None" path, the whole script fails. Let's "fix" it.
|
|
|
|
touch .gclient
|
|
|
|
# Another option would be to checkout "buildtools" inside the Electron checkout,
|
|
|
|
# but then we would lint its contents (at least gn format), and it doesn't pass it.
|
|
|
|
|
|
|
|
cd src/electron
|
2019-06-19 00:42:42 +03:00
|
|
|
node script/yarn install --frozen-lockfile
|
2019-06-06 02:30:39 +03:00
|
|
|
node script/yarn lint
|
2020-08-07 23:49:07 +03:00
|
|
|
- run:
|
|
|
|
name: Run Script Typechecker
|
|
|
|
command: |
|
|
|
|
cd src/electron
|
|
|
|
node script/yarn tsc -p tsconfig.script.json
|
2019-02-06 23:53:25 +03:00
|
|
|
|
2021-11-30 02:09:07 +03:00
|
|
|
# List of always run jobs.
|
2017-09-13 16:48:19 +03:00
|
|
|
jobs:
|
2019-02-06 23:53:25 +03:00
|
|
|
lint:
|
2021-05-10 11:18:59 +03:00
|
|
|
executor:
|
|
|
|
name: linux-docker
|
|
|
|
size: medium
|
2019-02-06 23:53:25 +03:00
|
|
|
environment:
|
|
|
|
<<: *env-linux-medium
|
|
|
|
<<: *steps-lint
|
|
|
|
|
2021-11-30 02:09:07 +03:00
|
|
|
# Initial setup workflow
|
2017-09-13 16:48:19 +03:00
|
|
|
workflows:
|
2019-02-06 23:53:25 +03:00
|
|
|
lint:
|
|
|
|
jobs:
|
2021-11-30 02:09:07 +03:00
|
|
|
# Job inherited from path-filtering orb
|
|
|
|
- path-filtering/filter:
|
|
|
|
base-revision: main
|
|
|
|
# Params for mapping; `path-to-test parameter-to-set value-for-parameter` for each row
|
|
|
|
mapping: |
|
|
|
|
^((?!docs/).)*$ run-build-mac true
|
|
|
|
^((?!docs/).)*$ run-build-linux true
|
|
|
|
docs/.* run-docs-only true
|
|
|
|
^((?!docs/).)*$ run-docs-only false
|
|
|
|
config-path: .circleci/build_config.yml
|
2019-02-06 23:53:25 +03:00
|
|
|
- lint
|