mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
42 Commits
refactor/a
...
win-cross
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
796be5100a | ||
|
|
f0923d8ca8 | ||
|
|
755a667b7c | ||
|
|
3e5e61ae96 | ||
|
|
00472c7e15 | ||
|
|
60e769a12f | ||
|
|
e2f9230952 | ||
|
|
2015489829 | ||
|
|
3dab62a5b0 | ||
|
|
973ed113ec | ||
|
|
0b709a9fd4 | ||
|
|
8172dee9d1 | ||
|
|
69412cb5f1 | ||
|
|
684a029d92 | ||
|
|
f32e8766a7 | ||
|
|
41447af5bb | ||
|
|
4a92ec0e90 | ||
|
|
af4eaada02 | ||
|
|
7ab051c083 | ||
|
|
062580c4a5 | ||
|
|
6af09fc7b8 | ||
|
|
258da5e0d5 | ||
|
|
218b836e28 | ||
|
|
534e4c1236 | ||
|
|
c958cccd22 | ||
|
|
7f9f9f34b5 | ||
|
|
e9b8188e9f | ||
|
|
89d77e39f4 | ||
|
|
1a0bac3328 | ||
|
|
f6fc8b204b | ||
|
|
6d6f7d0ee6 | ||
|
|
2649a5bbec | ||
|
|
72b5e59dce | ||
|
|
4cd51a13b0 | ||
|
|
5677aab327 | ||
|
|
d6ad4ca931 | ||
|
|
2d756bfa0b | ||
|
|
821feffdd3 | ||
|
|
6c47012326 | ||
|
|
61dfa7ebc3 | ||
|
|
86dfd98746 | ||
|
|
8f7c6d7a81 |
10
.github/actions/build-electron/action.yml
vendored
10
.github/actions/build-electron/action.yml
vendored
@@ -32,6 +32,12 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
GN_APPENDED_ARGS="$GN_EXTRA_ARGS v8_snapshot_toolchain=\"//build/toolchain/mac:clang_x64\""
|
GN_APPENDED_ARGS="$GN_EXTRA_ARGS v8_snapshot_toolchain=\"//build/toolchain/mac:clang_x64\""
|
||||||
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
||||||
|
- name: Set GN_EXTRA_ARGS for Win/cross
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.target-platform == 'windows' }}
|
||||||
|
run: |
|
||||||
|
GN_APPENDED_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
|
||||||
|
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
||||||
- name: Build Electron ${{ inputs.step-suffix }}
|
- name: Build Electron ${{ inputs.step-suffix }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -57,7 +63,7 @@ runs:
|
|||||||
cd src
|
cd src
|
||||||
e build electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES
|
e build electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
if [ "${{ env.CHECK_DIST_MANIFEST }}" = "true" ]; then
|
if [ "${{ env.CHECK_DIST_MANIFEST }}" = "true" ]; then
|
||||||
target_os=${{ inputs.target-platform == 'linux' && 'linux' || 'mac'}}
|
target_os=${{ inputs.target-platform == 'linux' && 'linux' || (inputs.target-platform == 'windows' && 'win' || 'mac') }}
|
||||||
if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
|
if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
|
||||||
target_os="${target_os}_mas"
|
target_os="${target_os}_mas"
|
||||||
fi
|
fi
|
||||||
@@ -78,7 +84,7 @@ runs:
|
|||||||
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
||||||
sed $SEDOPTION '/The gn arg use_goma=true .*/d' out/Default/mksnapshot_args
|
sed $SEDOPTION '/The gn arg use_goma=true .*/d' out/Default/mksnapshot_args
|
||||||
|
|
||||||
if [ "`uname`" = "Linux" ]; then
|
if [ "${{ inputs.target-platform }}" = "linux" ]; then
|
||||||
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
||||||
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
|
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
|
||||||
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
|
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
|
||||||
|
|||||||
14
.github/actions/checkout/action.yml
vendored
14
.github/actions/checkout/action.yml
vendored
@@ -17,6 +17,12 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
cd src/electron
|
cd src/electron
|
||||||
node script/yarn install
|
node script/yarn install
|
||||||
|
- name: Load Build Tools
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export BUILD_TOOLS_SHA=2f67e10b9b6b5700b1c7940df412b0345257d9ae
|
||||||
|
npm i -g @electron/build-tools
|
||||||
|
e auto-update disable
|
||||||
- name: Get Depot Tools
|
- name: Get Depot Tools
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -68,13 +74,17 @@ runs:
|
|||||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
if: steps.check-cache.outputs.cache_exists == 'false'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
gclient config \
|
e d gclient config \
|
||||||
--name "src/electron" \
|
--name "src/electron" \
|
||||||
--unmanaged \
|
--unmanaged \
|
||||||
${GCLIENT_EXTRA_ARGS} \
|
${GCLIENT_EXTRA_ARGS} \
|
||||||
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
|
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
|
||||||
|
|
||||||
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync --with_branch_heads --with_tags -vvvvv
|
if [ "$TARGET_OS" != "" ]; then
|
||||||
|
echo "target_os=['$TARGET_OS']" >> ./.gclient
|
||||||
|
fi
|
||||||
|
|
||||||
|
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 e d gclient sync --with_branch_heads --with_tags -vvvvv
|
||||||
if [ "${{ inputs.is-release }}" != "true" ]; then
|
if [ "${{ inputs.is-release }}" != "true" ]; then
|
||||||
# Re-export all the patches to check if there were changes.
|
# Re-export all the patches to check if there were changes.
|
||||||
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
|
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
|
||||||
|
|||||||
47
.github/workflows/build.yml
vendored
47
.github/workflows/build.yml
vendored
@@ -18,6 +18,11 @@ on:
|
|||||||
description: 'Skip Linux builds'
|
description: 'Skip Linux builds'
|
||||||
default: false
|
default: false
|
||||||
required: false
|
required: false
|
||||||
|
skip-windows:
|
||||||
|
type: boolean
|
||||||
|
description: 'Skip Windows builds'
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
skip-lint:
|
skip-lint:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: 'Skip lint check'
|
description: 'Skip lint check'
|
||||||
@@ -63,9 +68,31 @@ jobs:
|
|||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
# Checkout Jobs
|
# Checkout Jobs
|
||||||
|
checkout-windows:
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
|
runs-on: aks-linux-large
|
||||||
|
container:
|
||||||
|
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||||
|
options: --user root --device /dev/fuse --cap-add SYS_ADMIN
|
||||||
|
volumes:
|
||||||
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
|
env:
|
||||||
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
|
||||||
|
TARGET_OS: 'win'
|
||||||
|
ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1'
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Checkout & Sync & Save
|
||||||
|
uses: ./src/electron/.github/actions/checkout
|
||||||
checkout-macos:
|
checkout-macos:
|
||||||
needs: changes
|
needs: changes
|
||||||
if: ${{ needs.changes.outputs.src == 'true' && !inputs.skip-macos}}
|
if: false
|
||||||
|
# if: ${{ needs.changes.outputs.src == 'true' && !inputs.skip-macos}}
|
||||||
runs-on: aks-linux-large
|
runs-on: aks-linux-large
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||||
@@ -88,7 +115,8 @@ jobs:
|
|||||||
|
|
||||||
checkout-linux:
|
checkout-linux:
|
||||||
needs: changes
|
needs: changes
|
||||||
if: ${{ needs.changes.outputs.src == 'true' && !inputs.skip-linux}}
|
if: false
|
||||||
|
# if: ${{ needs.changes.outputs.src == 'true' && !inputs.skip-linux}}
|
||||||
runs-on: aks-linux-large
|
runs-on: aks-linux-large
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||||
@@ -151,6 +179,21 @@ jobs:
|
|||||||
generate-symbols: false
|
generate-symbols: false
|
||||||
upload-to-storage: '0'
|
upload-to-storage: '0'
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
windows-x64:
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: checkout-windows
|
||||||
|
with:
|
||||||
|
build-runs-on: aks-linux-large
|
||||||
|
test-runs-on: windows-2022
|
||||||
|
build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root --device /dev/fuse --cap-add SYS_ADMIN","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
target-platform: windows
|
||||||
|
target-arch: x64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
linux-arm:
|
linux-arm:
|
||||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
target-platform:
|
target-platform:
|
||||||
type: string
|
type: string
|
||||||
description: 'Platform to run on, can be macos or linux'
|
description: 'Platform to run on, can be macos, linux or windows'
|
||||||
required: true
|
required: true
|
||||||
target-arch:
|
target-arch:
|
||||||
type: string
|
type: string
|
||||||
@@ -58,7 +58,7 @@ env:
|
|||||||
ELECTRON_GITHUB_TOKEN: ${{ secrets.ELECTRON_GITHUB_TOKEN }}
|
ELECTRON_GITHUB_TOKEN: ${{ secrets.ELECTRON_GITHUB_TOKEN }}
|
||||||
# Disable pre-compiled headers to reduce out size - only useful for rebuilds
|
# Disable pre-compiled headers to reduce out size - only useful for rebuilds
|
||||||
GN_BUILDFLAG_ARGS: 'enable_precompiled_headers=false'
|
GN_BUILDFLAG_ARGS: 'enable_precompiled_headers=false'
|
||||||
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
|
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || (inputs.target-platform == 'linux' && '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' || '--custom-var=checkout_win=True') }}
|
||||||
# Only disable this in the Asan build
|
# Only disable this in the Asan build
|
||||||
CHECK_DIST_MANIFEST: true
|
CHECK_DIST_MANIFEST: true
|
||||||
IS_GHA_RELEASE: true
|
IS_GHA_RELEASE: true
|
||||||
@@ -93,6 +93,10 @@ jobs:
|
|||||||
- name: Install AZCopy
|
- name: Install AZCopy
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
run: brew install azcopy
|
run: brew install azcopy
|
||||||
|
- name: Enable windows toolchain
|
||||||
|
if: ${{ inputs.target-platform == 'windows' }}
|
||||||
|
run: |
|
||||||
|
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
|
||||||
- name: Set GN_EXTRA_ARGS for Linux
|
- name: Set GN_EXTRA_ARGS for Linux
|
||||||
if: ${{ inputs.target-platform == 'linux' }}
|
if: ${{ inputs.target-platform == 'linux' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -133,7 +137,7 @@ jobs:
|
|||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||||
- name: Restore src cache via AKS
|
- name: Restore src cache via AKS
|
||||||
if: ${{ inputs.target-platform == 'linux' }}
|
if: ${{ inputs.target-platform == 'linux' || inputs.target-platform == 'windows' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||||
- name: Checkout Electron
|
- name: Checkout Electron
|
||||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
|
||||||
@@ -148,7 +152,18 @@ jobs:
|
|||||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }} --only-sdk
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }} --only-sdk
|
||||||
- name: Run Electron Only Hooks
|
- name: Run Electron Only Hooks
|
||||||
run: |
|
run: |
|
||||||
gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
|
||||||
|
if [ "${{ inputs.target-platform }}" = "windows" ]; then
|
||||||
|
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False,'install_sysroot':False,'checkout_win':True},'managed':False}]" > tmpgclient
|
||||||
|
echo "target_os=['win']" >> tmpgclient
|
||||||
|
fi
|
||||||
|
gclient runhooks --gclientfile=tmpgclient
|
||||||
|
|
||||||
|
# Fix VS Toolchain
|
||||||
|
if [ "${{ inputs.target-platform }}" = "windows" ]; then
|
||||||
|
rm -rf src/third_party/depot_tools/win_toolchain/vs_files
|
||||||
|
e d python3 src/build/vs_toolchain.py update --force
|
||||||
|
fi
|
||||||
- name: Regenerate DEPS Hash
|
- name: Regenerate DEPS Hash
|
||||||
run: |
|
run: |
|
||||||
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
||||||
@@ -178,7 +193,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
target-arch: ${{ inputs.target-arch }}
|
target-arch: ${{ inputs.target-arch }}
|
||||||
target-platform: ${{ inputs.target-platform }}
|
target-platform: ${{ inputs.target-platform }}
|
||||||
artifact-platform: ${{ inputs.target-platform == 'linux' && 'linux' || 'darwin' }}
|
artifact-platform: ${{ inputs.target-platform == 'macos' && 'darwin' || inputs.target-platform }}
|
||||||
is-release: '${{ inputs.is-release }}'
|
is-release: '${{ inputs.is-release }}'
|
||||||
generate-symbols: '${{ inputs.generate-symbols }}'
|
generate-symbols: '${{ inputs.generate-symbols }}'
|
||||||
upload-to-storage: '${{ inputs.upload-to-storage }}'
|
upload-to-storage: '${{ inputs.upload-to-storage }}'
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ concurrency:
|
|||||||
env:
|
env:
|
||||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||||
GN_BUILDFLAG_ARGS: 'enable_precompiled_headers=false'
|
GN_BUILDFLAG_ARGS: 'enable_precompiled_headers=false'
|
||||||
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
|
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || (inputs.target-platform == 'linux' && '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' || '--custom-var=checkout_win=True') }}
|
||||||
ELECTRON_OUT_DIR: Default
|
ELECTRON_OUT_DIR: Default
|
||||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || fromJSON('["linux"]') }}
|
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'windows' && fromJSON('["windows"]') || fromJSON('["linux"]')) }}
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: ${{ matrix.build-type }}
|
BUILD_TYPE: ${{ matrix.build-type }}
|
||||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
@@ -91,6 +91,15 @@ jobs:
|
|||||||
GN_EXTRA_ARGS='fatal_linker_warnings=false enable_linux_installer=false'
|
GN_EXTRA_ARGS='fatal_linker_warnings=false enable_linux_installer=false'
|
||||||
fi
|
fi
|
||||||
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
||||||
|
- name: Set GN_EXTRA_ARGS for Win/cross
|
||||||
|
if: ${{ inputs.target-platform == 'windows' }}
|
||||||
|
run: |
|
||||||
|
GN_APPENDED_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
|
||||||
|
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
||||||
|
- name: Enable windows toolchain
|
||||||
|
if: ${{ inputs.target-platform == 'windows' }}
|
||||||
|
run: |
|
||||||
|
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
|
||||||
- name: Generate DEPS Hash
|
- name: Generate DEPS Hash
|
||||||
run: |
|
run: |
|
||||||
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
||||||
@@ -101,11 +110,16 @@ jobs:
|
|||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||||
- name: Restore src cache via AKS
|
- name: Restore src cache via AKS
|
||||||
if: ${{ inputs.target-platform == 'linux' }}
|
if: ${{ inputs.target-platform == 'linux' || inputs.target-platform == 'windows' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||||
- name: Run Electron Only Hooks
|
- name: Run Electron Only Hooks
|
||||||
run: |
|
run: |
|
||||||
gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
|
||||||
|
if [ "${{ inputs.target-platform }}" = "windows" ]; then
|
||||||
|
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False,'install_sysroot':False,'checkout_win':True},'managed':False}]" > tmpgclient
|
||||||
|
echo "target_os=['win']" >> tmpgclient
|
||||||
|
fi
|
||||||
|
gclient runhooks --gclientfile=tmpgclient
|
||||||
- name: Regenerate DEPS Hash
|
- name: Regenerate DEPS Hash
|
||||||
run: |
|
run: |
|
||||||
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
||||||
@@ -127,9 +141,9 @@ jobs:
|
|||||||
- name: Run GN Check
|
- name: Run GN Check
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
gn check out/Default //electron:electron_lib
|
e d gn check out/Default //electron:electron_lib
|
||||||
gn check out/Default //electron:electron_app
|
e d gn check out/Default //electron:electron_app
|
||||||
gn check out/Default //electron/shell/common/api:mojo
|
e d gn check out/Default //electron/shell/common/api:mojo
|
||||||
|
|
||||||
# Check the hunspell filenames
|
# Check the hunspell filenames
|
||||||
node electron/script/gen-hunspell-filenames.js --check
|
node electron/script/gen-hunspell-filenames.js --check
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || fromJSON('["linux"]') }}
|
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'windows' && fromJSON('["windows"]') || fromJSON('["linux"]')) }}
|
||||||
shard: ${{ inputs.target-platform == 'macos' && fromJSON('[1]') || fromJSON('[1, 2, 3]') }}
|
shard: ${{ inputs.target-platform == 'macos' && fromJSON('[1]') || fromJSON('[1, 2, 3]') }}
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: ${{ matrix.build-type }}
|
BUILD_TYPE: ${{ matrix.build-type }}
|
||||||
@@ -47,11 +47,13 @@ jobs:
|
|||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd src/electron
|
cd src/electron
|
||||||
node script/yarn install
|
node script/yarn install
|
||||||
- name: Get Depot Tools
|
- name: Get Depot Tools
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
if [ "`uname`" = "Darwin" ]; then
|
if [ "`uname`" = "Darwin" ]; then
|
||||||
@@ -59,14 +61,12 @@ jobs:
|
|||||||
sed -i '' '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
sed -i '' '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
||||||
else
|
else
|
||||||
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
||||||
# Remove swift-format dep from cipd on macOS until we send a patch upstream.
|
|
||||||
cd depot_tools
|
|
||||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
|
||||||
fi
|
fi
|
||||||
# Ensure depot_tools does not update.
|
# Ensure depot_tools does not update.
|
||||||
test -d depot_tools && cd depot_tools
|
test -d depot_tools && cd depot_tools
|
||||||
touch .disable_auto_update
|
touch .disable_auto_update
|
||||||
- name: Add Depot Tools to PATH
|
- name: Add Depot Tools to PATH
|
||||||
|
shell: bash
|
||||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||||
- name: Download Generated Artifacts
|
- name: Download Generated Artifacts
|
||||||
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
|
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
|
||||||
@@ -79,8 +79,10 @@ jobs:
|
|||||||
name: src_artifacts_${{ matrix.build-type }}_${{ env.TARGET_ARCH }}
|
name: src_artifacts_${{ matrix.build-type }}_${{ env.TARGET_ARCH }}
|
||||||
path: ./src_artifacts_${{ matrix.build-type }}_${{ env.TARGET_ARCH }}
|
path: ./src_artifacts_${{ matrix.build-type }}_${{ env.TARGET_ARCH }}
|
||||||
- name: Restore Generated Artifacts
|
- name: Restore Generated Artifacts
|
||||||
|
shell: bash
|
||||||
run: ./src/electron/script/actions/restore-artifacts.sh
|
run: ./src/electron/script/actions/restore-artifacts.sh
|
||||||
- name: Unzip Dist, Mksnapshot & Chromedriver
|
- name: Unzip Dist, Mksnapshot & Chromedriver
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd src/out/Default
|
cd src/out/Default
|
||||||
unzip -:o dist.zip
|
unzip -:o dist.zip
|
||||||
@@ -93,6 +95,7 @@ jobs:
|
|||||||
# cd src/electron
|
# cd src/electron
|
||||||
# ./script/codesign/generate-identity.sh
|
# ./script/codesign/generate-identity.sh
|
||||||
- name: Run Electron Tests
|
- name: Run Electron Tests
|
||||||
|
shell: bash
|
||||||
env:
|
env:
|
||||||
MOCHA_REPORTER: mocha-multi-reporters
|
MOCHA_REPORTER: mocha-multi-reporters
|
||||||
ELECTRON_TEST_RESULTS_DIR: junit
|
ELECTRON_TEST_RESULTS_DIR: junit
|
||||||
@@ -100,14 +103,15 @@ jobs:
|
|||||||
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
||||||
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
||||||
DISPLAY: ':99.0'
|
DISPLAY: ':99.0'
|
||||||
|
NPM_CONFIG_MSVS_VERSION: '2022'
|
||||||
run: |
|
run: |
|
||||||
cd src/electron
|
cd src/electron
|
||||||
# Get which tests are on this shard
|
# Get which tests are on this shard
|
||||||
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'macos' && 1 || 3 }})
|
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'macos' && 1 || 3 }})
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
if [ "`uname`" = "Darwin" ]; then
|
if [ "${{ inputs.target-platform }}" != "linux" ]; then
|
||||||
node script/yarn test --runners=main --trace-uncaught --enable-logging
|
node script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
|
||||||
else
|
else
|
||||||
chown :builduser .. && chmod g+w ..
|
chown :builduser .. && chmod g+w ..
|
||||||
chown -R :builduser . && chmod -R g+w .
|
chown -R :builduser . && chmod -R g+w .
|
||||||
@@ -117,6 +121,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
- name: Wait for active SSH sessions
|
- name: Wait for active SSH sessions
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
while [ -f /var/.ssh-lock ]
|
while [ -f /var/.ssh-lock ]
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -7,7 +7,11 @@ if [ "`uname`" == "Darwin" ]; then
|
|||||||
BUILD_TYPE="mas"
|
BUILD_TYPE="mas"
|
||||||
fi
|
fi
|
||||||
elif [ "`uname`" == "Linux" ]; then
|
elif [ "`uname`" == "Linux" ]; then
|
||||||
BUILD_TYPE="linux"
|
if [ "$ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN" == "1" ]; then
|
||||||
|
BUILD_TYPE="windows"
|
||||||
|
else
|
||||||
|
BUILD_TYPE="linux"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Unsupported platform"
|
echo "Unsupported platform"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -46,24 +50,47 @@ cp_if_exist() {
|
|||||||
move_src_dirs_if_exist() {
|
move_src_dirs_if_exist() {
|
||||||
mkdir src_artifacts
|
mkdir src_artifacts
|
||||||
|
|
||||||
for dir in \
|
dirs=("src/out/Default/gen/node_headers" \
|
||||||
src/out/Default/gen/node_headers \
|
"src/out/Default/overlapped-checker" \
|
||||||
src/out/Default/overlapped-checker \
|
"src/out/Default/ffmpeg" \
|
||||||
src/out/Default/ffmpeg \
|
"src/out/Default/hunspell_dictionaries" \
|
||||||
src/out/Default/hunspell_dictionaries \
|
"src/third_party/electron_node" \
|
||||||
src/electron \
|
"src/third_party/nan" \
|
||||||
src/third_party/electron_node \
|
"src/cross-arch-snapshots" \
|
||||||
src/third_party/nan \
|
"src/buildtools/mac" \
|
||||||
src/cross-arch-snapshots \
|
"src/buildtools/third_party/libc++" \
|
||||||
src/third_party/llvm-build \
|
"src/buildtools/third_party/libc++abi" \
|
||||||
src/build/linux \
|
"src/third_party/libc++" \
|
||||||
src/buildtools/mac \
|
"src/third_party/libc++abi" \
|
||||||
src/buildtools/third_party/libc++ \
|
"src/out/Default/obj/buildtools/third_party" \
|
||||||
src/buildtools/third_party/libc++abi \
|
"src/v8/tools/builtins-pgo")
|
||||||
src/third_party/libc++ \
|
|
||||||
src/third_party/libc++abi \
|
# Only do this for linux build type, this folder
|
||||||
src/out/Default/obj/buildtools/third_party \
|
# exists for windows builds on linux hosts but we do
|
||||||
src/v8/tools/builtins-pgo
|
# not need it
|
||||||
|
if [ "$BUILD_TYPE" == "linux" ]; then
|
||||||
|
dirs+=('src/build/linux')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# llvm-build is the host toolchain, for windows we need
|
||||||
|
# a different toolchain so no point copying this one
|
||||||
|
if [ "$BUILD_TYPE" != "windows" ]; then
|
||||||
|
dirs+=('src/third_party/llvm-build')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# On windows we should clean up two symlinks that aren't
|
||||||
|
# compatible with the windows test runner
|
||||||
|
if [ "$BUILD_TYPE" == "windows" ]; then
|
||||||
|
rm -f src/third_party/electron_node/tools/node_modules/eslint/node_modules/eslint
|
||||||
|
rm -f src/third_party/electron_node/tools/node_modules/eslint/node_modules/.bin/eslint
|
||||||
|
rm -f src/third_party/electron_node/out/tools/bin/python
|
||||||
|
|
||||||
|
# Also need to copy electron.lib to node.lib for native module testing purposes
|
||||||
|
mkdir -p src/out/Default/gen/node_headers/Release
|
||||||
|
cp src/out/Default/electron.lib src/out/Default/gen/node_headers/Release/node.lib
|
||||||
|
fi
|
||||||
|
|
||||||
|
for dir in "${dirs[@]}"
|
||||||
do
|
do
|
||||||
if [ -d "$dir" ]; then
|
if [ -d "$dir" ]; then
|
||||||
mkdir -p src_artifacts/$(dirname $dir)
|
mkdir -p src_artifacts/$(dirname $dir)
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ const HASH_VERSIONS = {
|
|||||||
const filesToHash = [
|
const filesToHash = [
|
||||||
path.resolve(__dirname, '../DEPS'),
|
path.resolve(__dirname, '../DEPS'),
|
||||||
path.resolve(__dirname, '../yarn.lock'),
|
path.resolve(__dirname, '../yarn.lock'),
|
||||||
path.resolve(__dirname, '../script/sysroots.json')
|
path.resolve(__dirname, '../script/sysroots.json'),
|
||||||
|
path.resolve(__dirname, '../.github/actions/checkout/action.yml')
|
||||||
];
|
];
|
||||||
|
|
||||||
const addAllFiles = (dir) => {
|
const addAllFiles = (dir) => {
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ async function main () {
|
|||||||
const outDir = utils.getOutDir({ shouldLog: true });
|
const outDir = utils.getOutDir({ shouldLog: true });
|
||||||
const nodeDir = path.resolve(BASE, 'out', outDir, 'gen', 'node_headers');
|
const nodeDir = path.resolve(BASE, 'out', outDir, 'gen', 'node_headers');
|
||||||
const env = {
|
const env = {
|
||||||
|
npm_config_msvs_version: '2019',
|
||||||
...process.env,
|
...process.env,
|
||||||
npm_config_nodedir: nodeDir,
|
npm_config_nodedir: nodeDir,
|
||||||
npm_config_msvs_version: '2019',
|
|
||||||
npm_config_arch: process.env.NPM_CONFIG_ARCH,
|
npm_config_arch: process.env.NPM_CONFIG_ARCH,
|
||||||
npm_config_yes: 'true'
|
npm_config_yes: 'true'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -191,9 +191,9 @@ async function installSpecModules (dir) {
|
|||||||
const CXXFLAGS = ['-std=c++17', process.env.CXXFLAGS].filter(x => !!x).join(' ');
|
const CXXFLAGS = ['-std=c++17', process.env.CXXFLAGS].filter(x => !!x).join(' ');
|
||||||
|
|
||||||
const env = {
|
const env = {
|
||||||
|
npm_config_msvs_version: '2019',
|
||||||
...process.env,
|
...process.env,
|
||||||
CXXFLAGS,
|
CXXFLAGS,
|
||||||
npm_config_msvs_version: '2019',
|
|
||||||
npm_config_yes: 'true'
|
npm_config_yes: 'true'
|
||||||
};
|
};
|
||||||
if (args.electronVersion) {
|
if (args.electronVersion) {
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ app.whenReady().then(async () => {
|
|||||||
const validTestPaths = argv.files && argv.files.map(file =>
|
const validTestPaths = argv.files && argv.files.map(file =>
|
||||||
path.isAbsolute(file)
|
path.isAbsolute(file)
|
||||||
? path.relative(baseElectronDir, file)
|
? path.relative(baseElectronDir, file)
|
||||||
: file);
|
: path.normalize(file));
|
||||||
const filter = (file) => {
|
const filter = (file) => {
|
||||||
if (!/-spec\.[tj]s$/.test(file)) {
|
if (!/-spec\.[tj]s$/.test(file)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user