Compare commits

...

70 Commits

Author SHA1 Message Date
Samuel Attard
e73aed7936 remove debug 2024-10-06 15:10:29 -07:00
Samuel Attard
a95d0cc1f1 fix loop 2024-10-06 15:08:21 -07:00
Samuel Attard
ff97d98dee ensure clean args 2024-10-06 14:58:57 -07:00
Samuel Attard
db5657f52d build: use single check per platform 2024-10-06 14:35:16 -07:00
Samuel Attard
4a99db3576 clean up depshash logic 2024-10-06 14:14:55 -07:00
Samuel Attard
05fc3cbdd2 maybe arm sdk 2024-10-06 13:53:12 -07:00
Samuel Attard
d6e6dd2841 windows hax for non windows 2024-10-06 13:50:51 -07:00
Samuel Attard
86a37f598f install visual studio on arm64 2024-10-06 01:10:44 -07:00
Samuel Attard
ad6f911993 run all CI 2024-10-06 00:48:15 -07:00
Samuel Attard
5197c9bcb4 no progress 2024-10-06 00:47:51 -07:00
Samuel Attard
d12d07fcfb disable some fullscreen tests on GHA 2024-10-05 23:12:16 -07:00
Samuel Attard
a6a9093e76 vsctools + logging 2024-10-05 22:10:19 -07:00
Samuel Attard
f7d38dd660 remove 1080p force thing 2024-10-05 21:41:32 -07:00
Samuel Attard
4c4d213c79 line endings will be the death of me 2024-10-05 21:40:14 -07:00
Samuel Attard
fc79921163 ... more logs 2024-10-05 20:55:36 -07:00
Samuel Attard
66f756b94b logs 2024-10-05 18:51:19 -07:00
Samuel Attard
0d2124c4bb wat 2024-10-04 17:53:29 -07:00
Samuel Attard
d5919e9641 screen res 2024-10-04 10:23:20 -07:00
Samuel Attard
6c25b8e62a sigh 2024-10-04 10:19:01 -07:00
Samuel Attard
5e39c7b932 overwrite -Force 2024-10-04 08:44:06 -07:00
Samuel Attard
10cac6c432 fix windows tests 2024-10-04 01:41:42 -07:00
Samuel Attard
100cf61dc8 fix some spec runner stuff 2024-10-04 00:17:57 -07:00
Samuel Attard
044780480b correct windows sharding 2024-10-03 22:24:21 -07:00
Samuel Attard
26f5df4754 build: set up nodejs 2024-10-03 22:22:54 -07:00
Samuel Attard
1262b2a126 maybe bash 2024-10-03 19:17:38 -07:00
Samuel Attard
55c150c39b 32 bit on 32 bit 2024-10-03 16:20:33 -07:00
Samuel Attard
e082304e3c build: windows tar is ass 2024-10-03 14:53:11 -07:00
Samuel Attard
349d25b04d build: get arm64 windows closer to working 2024-10-03 10:30:48 -07:00
Samuel Attard
dc1dc699de build: no patch depot_tools for tests 2024-10-03 10:24:54 -07:00
Samuel Attard
9d4e5ee4e7 build: ia32 zip manifest 2024-10-03 10:04:43 -07:00
Samuel Attard
a843c9f951 build: configure git global on win 2024-10-03 01:51:29 -07:00
Samuel Attard
c37acb7562 build: keep action around for post step 2024-10-03 01:50:44 -07:00
Samuel Attard
5e43a7e53a Merge remote-tracking branch 'origin/main' into windows-runner 2024-10-03 01:21:26 -07:00
Samuel Attard
fcb6dc81d8 maybe not needed 2024-10-03 00:46:13 -07:00
Samuel Attard
a5ee213d8e clean up 2024-10-03 00:45:43 -07:00
Samuel Attard
29d1dadf8e build: enable x86 and arm64 windows builds too 2024-10-03 00:43:21 -07:00
Samuel Attard
7ab4a36ccb build: use powershell to add mksnapshot_args 2024-10-02 23:36:34 -07:00
Samuel Attard
2a7e9b45a6 fix toolchain on windows cross check 2024-10-02 22:40:37 -07:00
Samuel Attard
a7103a4042 no log 2024-10-02 22:37:13 -07:00
Samuel Attard
c415741405 e d 2024-10-02 22:36:19 -07:00
Samuel Attard
cda341b080 build: e d 2024-10-02 21:35:27 -07:00
Samuel Attard
da411de1c8 cry ? 2024-10-02 21:26:02 -07:00
Samuel Attard
38bdb32040 use container... 2024-10-02 21:20:01 -07:00
Samuel Attard
f40456a426 build: run gn-check for windows on linux hosts for speed 2024-10-02 21:09:10 -07:00
Samuel Attard
868b800fe9 build: yolo some stuff 2024-10-02 20:26:56 -07:00
Samuel Attard
247182e952 no double checkout 2024-10-02 19:09:48 -07:00
Samuel Attard
2e090ceb6a ... 2024-10-02 18:08:11 -07:00
Samuel Attard
a42d0a6fb2 sigh 2024-10-02 08:25:59 -07:00
Samuel Attard
2abbc4b28c idk 2024-10-02 00:00:30 -07:00
Samuel Attard
9075e2b20d no check 2024-10-01 21:34:17 -07:00
Samuel Attard
d2fca2bbf7 sup 2024-10-01 21:33:36 -07:00
Samuel Attard
960541743b build: checkout on windows host 2024-10-01 20:19:56 -07:00
Samuel Attard
ca071c17e6 build: platform strings are hard 2024-09-27 16:16:54 -07:00
Samuel Attard
3c85204883 build: force lf endings for lock and DEPS 2024-09-27 09:41:01 -07:00
Samuel Attard
6db7a0f0af build: depshash logging 2024-09-27 09:25:44 -07:00
Samuel Attard
f7ac1bf039 build: past sam was a silly goose 2024-09-27 09:14:37 -07:00
Samuel Attard
51497a9452 build: output depshash for debugging 2024-09-27 09:11:26 -07:00
Samuel Attard
e5b62f4c97 build: sync gclient vars to build windows job 2024-09-27 09:04:21 -07:00
Samuel Attard
395526f45a build: use build-tools gclient 2024-09-27 08:43:13 -07:00
Samuel Attard
872d80cfc2 build: restore cache on windows 2024-09-27 08:42:24 -07:00
Samuel Attard
6859b2d5ea just pain 2024-09-27 08:35:07 -07:00
Samuel Attard
288441ec9e build: force windows cipd init and python3 existence 2024-09-27 08:23:25 -07:00
Samuel Attard
3addfb1943 build: use sha1sum 2024-09-27 07:52:58 -07:00
Samuel Attard
5c40f3595f build: configure windows correctly 2024-09-27 07:30:04 -07:00
Samuel Attard
cd5eb75260 build: bash as default 2024-09-27 07:21:32 -07:00
Samuel Attard
a1799f33cb build: configure git for windows build tools 2024-09-27 07:11:37 -07:00
Samuel Attard
ed0cc27f81 build: use bash as default shell always 2024-09-27 01:10:07 -07:00
Samuel Attard
96c7e69c73 build: take win/cross changes 2024-09-26 14:23:52 -07:00
Samuel Attard
5f0b657f86 build: try build windows on windows? 2024-09-26 14:04:02 -07:00
Samuel Attard
f86111130b build: test windows runner 2024-09-26 13:37:13 -07:00
19 changed files with 390 additions and 178 deletions

3
.gitattributes vendored
View File

@@ -1,6 +1,9 @@
# `git apply` and friends don't understand CRLF, even on windows. Force those
# files to be checked out with LF endings even if core.autocrlf is true.
*.patch text eol=lf
DEPS text eol=lf
yarn.lock text eol=lf
script/zip_manifests/*.manifest text eol=lf
patches/**/.patches merge=union
# Source code and markdown files should always use LF as line ending.

View File

@@ -8,7 +8,7 @@ inputs:
description: 'Target platform'
required: true
artifact-platform:
description: 'Artifact platform, should be linux, darwin or mas'
description: 'Artifact platform, should be linux, windows, darwin or mas'
required: true
step-suffix:
description: 'Suffix for build steps'
@@ -71,18 +71,22 @@ runs:
cd src
e build --target electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES
if [ "${{ inputs.is-asan }}" != "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
target_os="${target_os}_mas"
fi
electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.${{ inputs.target-arch }}.manifest
target_arch=${{ inputs.target-arch }}
if [ "${{ inputs.target-arch }}" = "x86" ]; then
target_arch="ia32"
fi
electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.$target_arch.manifest
fi
- name: Build Mksnapshot ${{ inputs.step-suffix }}
shell: bash
run: |
cd src
e build --target electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
ELECTRON_DEPOT_TOOLS_DISABLE_LOG=1 e d gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
# Remove unused args from mksnapshot_args
SEDOPTION="-i"
if [ "`uname`" = "Darwin" ]; then
@@ -91,7 +95,7 @@ runs:
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
if [ "`uname`" = "Linux" ]; then
if [ "${{ inputs.target-platform }}" = "linux" ]; 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/v8_context_snapshot_generator
@@ -105,7 +109,13 @@ runs:
fi
e build --target electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
if [ "${{ inputs.target-platform }}" = "windows" ]; then
cd out/Default
powershell Compress-Archive -update mksnapshot_args mksnapshot.zip
powershell Compress-Archive -update gen/v8/embedded.S mksnapshot.zip
else
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
fi
- name: Generate Cross-Arch Snapshot (arm/arm64) ${{ inputs.step-suffix }}
shell: bash
if: ${{ (inputs.target-arch == 'arm' || inputs.target-arch == 'arm64') && inputs.target-platform == 'linux' }}

View File

@@ -5,6 +5,10 @@ inputs:
description: 'Whether to generate and persist a SAS token for the item in the cache'
required: false
default: 'false'
use-cache:
description: 'Whether to persist the cache to the shared drive'
required: false
default: 'true'
runs:
using: "composite"
steps:
@@ -17,27 +21,31 @@ runs:
run: |
cd src/electron
node script/yarn install --frozen-lockfile
- name: Install Build Tools
uses: ./src/electron/.github/actions/install-build-tools
- name: Get Depot Tools
shell: bash
run: |
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
if [[ ! -d depot_tools ]]; then
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
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
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
# Ensure depot_tools does not update.
test -d depot_tools && cd depot_tools
touch .disable_auto_update
# Ensure depot_tools does not update.
test -d depot_tools && cd depot_tools
touch .disable_auto_update
fi
- name: Add Depot Tools to PATH
shell: bash
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
- name: Generate DEPS Hash
shell: bash
run: |
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
echo "DEPSHASH=v1-src-cache-$(shasum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
node src/electron/script/generate-deps-hash.js
echo "DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)" >> $GITHUB_ENV
- name: Generate SAS Key
if: ${{ inputs.generate-sas-token == 'true' }}
shell: bash
@@ -54,27 +62,36 @@ runs:
id: check-cache
shell: bash
run: |
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
echo "Using cache key: $DEPSHASH"
echo "Checking for cache in: $cache_path"
if [ ! -f "$cache_path" ]; then
if [[ "${{ inputs.use-cache }}" == "false" ]]; then
echo "Not using cache this time..."
echo "cache_exists=false" >> $GITHUB_OUTPUT
echo "Cache Does Not Exist for $DEPSHASH"
else
echo "cache_exists=true" >> $GITHUB_OUTPUT
echo "Cache Already Exists for $DEPSHASH, Skipping.."
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
echo "Using cache key: $DEPSHASH"
echo "Checking for cache in: $cache_path"
if [ ! -f "$cache_path" ]; then
echo "cache_exists=false" >> $GITHUB_OUTPUT
echo "Cache Does Not Exist for $DEPSHASH"
else
echo "cache_exists=true" >> $GITHUB_OUTPUT
echo "Cache Already Exists for $DEPSHASH, Skipping.."
fi
fi
- name: Gclient Sync
if: steps.check-cache.outputs.cache_exists == 'false'
shell: bash
run: |
gclient config \
e d gclient config \
--name "src/electron" \
--unmanaged \
${GCLIENT_EXTRA_ARGS} \
"$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 -vv
if [ "${{ inputs.is-release }}" != "true" && -n "${{ env.PATCH_UP_APP_CREDS }}" ]; then
# Re-export all the patches to check if there were changes.
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
@@ -115,13 +132,13 @@ runs:
# https://dawn-review.googlesource.com/c/dawn/+/83901
# TODO: maybe better to always leave out */.git/HEAD file for all targets ?
- name: Delete .git directories under src to free space
if: steps.check-cache.outputs.cache_exists == 'false'
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
shell: bash
run: |
cd src
( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" -not -path "./electron/*" ) | xargs rm -rf
- name: Minimize Cache Size for Upload
if: steps.check-cache.outputs.cache_exists == 'false'
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
shell: bash
run: |
rm -rf src/android_webview
@@ -132,9 +149,12 @@ runs:
rm -rf src/third_party/angle/third_party/VK-GL-CTS/src
rm -rf src/third_party/swift-toolchain
rm -rf src/third_party/swiftshader/tests/regres/testlists
cp src/electron/.github/actions/checkout/action.yml ./
rm -rf src/electron
mkdir -p src/electron/.github/actions/checkout
mv action.yml src/electron/.github/actions/checkout
- name: Compress Src Directory
if: steps.check-cache.outputs.cache_exists == 'false'
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
shell: bash
run: |
echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
@@ -142,7 +162,7 @@ runs:
echo "Compressed src to $(du -sh $DEPSHASH.tar | cut -f1 -d' ')"
cp ./$DEPSHASH.tar /mnt/cross-instance-cache/
- name: Persist Src Cache
if: steps.check-cache.outputs.cache_exists == 'false'
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
shell: bash
run: |
final_cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar

View File

@@ -6,6 +6,15 @@ runs:
- name: Install Build Tools
shell: bash
run: |
export BUILD_TOOLS_SHA=33dc5186556bfbf7b0121a00cdd89ed3802e47da
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
git config --global core.filemode false
git config --global core.autocrlf false
git config --global branch.autosetuprebase always
fi
export BUILD_TOOLS_SHA=c3e81edd054e26ec95167b6d87fe5add11dc79e6
npm i -g @electron/build-tools
e auto-update disable
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
e d cipd.bat --version
cp "C:\Python37\python.exe" "C:\Python37\python3.exe"
fi

View File

@@ -18,6 +18,11 @@ on:
description: 'Skip Linux builds'
default: false
required: false
skip-windows:
type: boolean
description: 'Skip Windows builds'
default: false
required: false
skip-lint:
type: boolean
description: 'Skip lint check'
@@ -28,7 +33,11 @@ on:
- main
- '[1-9][0-9]-x-y'
pull_request:
defaults:
run:
shell: bash
jobs:
setup:
runs-on: ubuntu-latest
@@ -127,6 +136,61 @@ jobs:
- name: Checkout & Sync & Save
uses: ./src/electron/.github/actions/checkout
checkout-windows:
needs: setup
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
runs-on: electron-arc-linux-amd64-32core
container:
image: ghcr.io/electron/build:${{ needs.setup.outputs.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
# GN Check Jobs
macos-gn-check:
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
needs: checkout-macos
with:
target-platform: macos
target-archs: x64 arm64
check-runs-on: macos-14
gn-build-type: testing
secrets: inherit
linux-gn-check:
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
needs: checkout-linux
with:
target-platform: linux
target-archs: x64 arm arm64
check-runs-on: electron-arc-linux-amd64-8core
check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
gn-build-type: testing
secrets: inherit
windows-gn-check:
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
needs: checkout-windows
with:
target-platform: windows
target-archs: x64 x86 arm64
check-runs-on: electron-arc-linux-amd64-8core
check-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"]}'
gn-build-type: testing
secrets: inherit
# Build Jobs - These cascade into testing jobs
macos-x64:
permissions:
@@ -137,7 +201,6 @@ jobs:
needs: checkout-macos
with:
build-runs-on: macos-14-xlarge
check-runs-on: macos-14
test-runs-on: macos-13
target-platform: macos
target-arch: x64
@@ -156,7 +219,6 @@ jobs:
needs: checkout-macos
with:
build-runs-on: macos-14-xlarge
check-runs-on: macos-14
test-runs-on: macos-14
target-platform: macos
target-arch: arm64
@@ -175,7 +237,6 @@ jobs:
needs: checkout-linux
with:
build-runs-on: electron-arc-linux-amd64-32core
check-runs-on: electron-arc-linux-amd64-8core
test-runs-on: electron-arc-linux-amd64-4core
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
@@ -196,7 +257,6 @@ jobs:
needs: checkout-linux
with:
build-runs-on: electron-arc-linux-amd64-32core
check-runs-on: electron-arc-linux-amd64-8core
test-runs-on: electron-arc-linux-amd64-4core
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
@@ -218,7 +278,6 @@ jobs:
needs: checkout-linux
with:
build-runs-on: electron-arc-linux-amd64-32core
check-runs-on: electron-arc-linux-amd64-8core
test-runs-on: electron-arc-linux-arm64-4core
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
test-container: '{"image":"ghcr.io/electron/test:arm32v7-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init","volumes":["/home/runner/externals:/mnt/runner-externals"]}'
@@ -239,7 +298,6 @@ jobs:
needs: checkout-linux
with:
build-runs-on: electron-arc-linux-amd64-32core
check-runs-on: electron-arc-linux-amd64-8core
test-runs-on: electron-arc-linux-arm64-4core
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
test-container: '{"image":"ghcr.io/electron/test:arm64v8-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
@@ -250,3 +308,60 @@ jobs:
generate-symbols: false
upload-to-storage: '0'
secrets: inherit
windows-x64:
permissions:
contents: read
issues: read
pull-requests: read
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
needs: setup
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
with:
build-runs-on: electron-arc-windows-amd64-16core
test-runs-on: windows-latest
target-platform: windows
target-arch: x64
is-release: false
gn-build-type: testing
generate-symbols: false
upload-to-storage: '0'
secrets: inherit
windows-x86:
permissions:
contents: read
issues: read
pull-requests: read
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
needs: setup
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
with:
build-runs-on: electron-arc-windows-amd64-16core
test-runs-on: windows-latest
target-platform: windows
target-arch: x86
is-release: false
gn-build-type: testing
generate-symbols: false
upload-to-storage: '0'
secrets: inherit
windows-arm64:
permissions:
contents: read
issues: read
pull-requests: read
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
needs: setup
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
with:
build-runs-on: electron-arc-windows-amd64-16core
test-runs-on: electron-hosted-windows-arm64-4core
target-platform: windows
target-arch: arm64
is-release: false
gn-build-type: testing
generate-symbols: false
upload-to-storage: '0'
secrets: inherit

View File

@@ -5,7 +5,7 @@ on:
inputs:
target-platform:
type: string
description: 'Platform to run on, can be macos or linux'
description: 'Platform to run on, can be macos, windows or linux.'
required: true
target-arch:
type: string
@@ -15,10 +15,6 @@ on:
type: string
description: 'What host to run the build'
required: true
check-runs-on:
type: string
description: 'What host to run the gn-check'
required: true
test-runs-on:
type: string
description: 'What host to run the tests on'
@@ -76,16 +72,6 @@ jobs:
generate-symbols: ${{ inputs.generate-symbols }}
upload-to-storage: ${{ inputs.upload-to-storage }}
secrets: inherit
gn-check:
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
with:
target-platform: ${{ inputs.target-platform }}
target-arch: ${{ inputs.target-arch }}
check-runs-on: ${{ inputs.check-runs-on }}
check-container: ${{ inputs.build-container }}
gn-build-type: ${{ inputs.gn-build-type }}
is-asan: ${{ inputs.is-asan }}
secrets: inherit
test:
uses: ./.github/workflows/pipeline-segment-electron-test.yml
needs: build

View File

@@ -5,7 +5,7 @@ on:
inputs:
target-platform:
type: string
description: 'Platform to run on, can be macos or linux'
description: 'Platform to run on, can be macos, windows or linux'
required: true
target-arch:
type: string
@@ -15,10 +15,6 @@ on:
type: string
description: 'What host to run the build'
required: true
check-runs-on:
type: string
description: 'What host to run the gn-check'
required: true
test-runs-on:
type: string
description: 'What host to run the tests on'
@@ -82,16 +78,6 @@ jobs:
upload-to-storage: ${{ inputs.upload-to-storage }}
is-asan: ${{ inputs.is-asan}}
secrets: inherit
gn-check:
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
with:
target-platform: ${{ inputs.target-platform }}
target-arch: ${{ inputs.target-arch }}
check-runs-on: ${{ inputs.check-runs-on }}
check-container: ${{ inputs.build-container }}
gn-build-type: ${{ inputs.gn-build-type }}
is-asan: ${{ inputs.is-asan }}
secrets: inherit
test:
uses: ./.github/workflows/pipeline-segment-electron-test.yml
needs: build

View File

@@ -9,7 +9,7 @@ on:
type: string
target-platform:
type: string
description: 'Platform to run on, can be macos or linux'
description: 'Platform to run on, can be macos, windows or linux'
required: true
target-arch:
type: string
@@ -69,11 +69,14 @@ env:
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }}
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 == 'windows' && '--custom-var=checkout_win=True' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
ELECTRON_OUT_DIR: Default
jobs:
build:
defaults:
run:
shell: bash
runs-on: ${{ inputs.build-runs-on }}
container: ${{ fromJSON(inputs.build-container) }}
environment: ${{ inputs.environment }}
@@ -81,7 +84,8 @@ jobs:
TARGET_ARCH: ${{ inputs.target-arch }}
steps:
- name: Create src dir
run: mkdir src
run: |
mkdir src
- name: Checkout Electron
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
@@ -145,8 +149,8 @@ jobs:
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
- name: Generate DEPS Hash
run: |
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
DEPSHASH=v1-src-cache-$(shasum src/electron/.depshash | cut -f1 -d' ')
node src/electron/script/generate-deps-hash.js
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
- name: Restore src cache via AZCopy
@@ -155,6 +159,11 @@ jobs:
- name: Restore src cache via AKS
if: ${{ inputs.target-platform == 'linux' }}
uses: ./src/electron/.github/actions/restore-cache-aks
- name: Checkout the whole damm thing
if: ${{ inputs.target-platform == 'windows' }}
uses: ./src/electron/.github/actions/checkout
with:
use-cache: 'false'
- name: Checkout Electron
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
@@ -167,11 +176,11 @@ jobs:
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
run: |
gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
e d gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
- name: Regenerate DEPS Hash
run: |
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
echo "DEPSHASH=$(shasum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
- name: Fix Sync (macOS)
@@ -179,8 +188,12 @@ jobs:
uses: ./src/electron/.github/actions/fix-sync-macos
- name: Install build-tools & Setup RBE
run: |
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform == 'linux' && '300' || '200' }}" >> $GITHUB_ENV
cd ~/.electron_build_tools
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform != 'macos' && '300' || '200' }}" >> $GITHUB_ENV
if [ "${{ inputs.target-platform }}" = "windows" ]; then
cd $(cygpath -u "$(e show depotdir)")/../..
else
cd "$(e show depotdir)/../.."
fi
npx yarn --ignore-engines
# Pull down credential helper and print status
node -e "require('./src/utils/reclient.js').downloadAndPrepare({})"
@@ -198,7 +211,7 @@ jobs:
with:
target-arch: ${{ inputs.target-arch }}
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 }}'
generate-symbols: '${{ inputs.generate-symbols }}'
strip-binaries: '${{ inputs.strip-binaries }}'

View File

@@ -5,11 +5,11 @@ on:
inputs:
target-platform:
type: string
description: 'Platform to run on, can be macos or linux'
description: 'Platform to run on, can be macos, windows or linux'
required: true
target-arch:
target-archs:
type: string
description: 'Arch to build for, can be x64, arm64 or arm'
description: 'Archs to check for, can be x64, x86, arm64 or arm space separated'
required: true
check-runs-on:
type: string
@@ -25,29 +25,23 @@ on:
required: true
type: string
default: testing
is-asan:
description: 'Building the Address Sanitizer (ASan) Linux build'
required: false
type: boolean
default: false
concurrency:
group: electron-gn-check-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref }}
group: electron-gn-check-${{ inputs.target-platform }}-${{ github.ref }}
cancel-in-progress: true
env:
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
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
TARGET_ARCH: ${{ inputs.target-arch }}
jobs:
gn-check:
# TODO(codebytere): Change this to medium VM
defaults:
run:
shell: bash
runs-on: ${{ inputs.check-runs-on }}
container: ${{ fromJSON(inputs.check-container) }}
env:
TARGET_ARCH: ${{ inputs.target-arch }}
steps:
- name: Checkout Electron
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
@@ -75,7 +69,7 @@ jobs:
uses: ./src/electron/.github/actions/install-build-tools
- name: Init Build Tools
run: |
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 }} --only-sdk
- name: Get Depot Tools
timeout-minutes: 5
run: |
@@ -97,34 +91,40 @@ jobs:
touch .disable_auto_update
- name: Add Depot Tools to PATH
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
- name: Set GN_EXTRA_ARGS for Linux
if: ${{ inputs.target-platform == 'linux' }}
- name: Enable windows toolchain
if: ${{ inputs.target-platform == 'windows' }}
run: |
if [ "${{ inputs.target-arch }}" = "arm" ]; then
GN_EXTRA_ARGS='build_tflite_with_xnnpack=false'
elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
GN_EXTRA_ARGS='fatal_linker_warnings=false enable_linux_installer=false'
fi
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
- name: Generate DEPS Hash
run: |
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
DEPSHASH=v1-src-cache-$(shasum src/electron/.depshash | cut -f1 -d' ')
node src/electron/script/generate-deps-hash.js
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
- name: Restore src cache via AZCopy
if: ${{ inputs.target-platform == 'macos' }}
uses: ./src/electron/.github/actions/restore-cache-azcopy
- 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
- name: Run Electron Only Hooks
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
e d 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
run: |
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
echo "DEPSHASH=$(shasum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
- name: Checkout Electron
@@ -136,22 +136,38 @@ jobs:
run: |
cd src/electron
git pack-refs
cd ..
e build --only-gen
- name: Run GN Check
- name: Run GN Check for ${{ inputs.target-archs }}
run: |
cd src
gn check out/Default //electron:electron_lib
gn check out/Default //electron:electron_app
gn check out/Default //electron/shell/common:mojo
gn check out/Default //electron/shell/common:plugin
# Check the hunspell filenames
node electron/script/gen-hunspell-filenames.js --check
node electron/script/gen-libc++-filenames.js --check
for target_cpu in ${{ inputs.target-archs }}
do
export GN_EXTRA_ARGS="target_cpu=\"$target_cpu\""
if [ "${{ inputs.target-platform }}" = "linux" ]; then
if [ "$target_cpu" = "arm" ]; then
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS build_tflite_with_xnnpack=false"
elif [ "$target_cpu" = "arm64" ]; then
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS fatal_linker_warnings=false enable_linux_installer=false"
fi
fi
if [ "${{ inputs.target-platform }}" = "windows" ]; then
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
fi
e build --only-gen
e d gn check out/Default //electron:electron_lib
e d gn check out/Default //electron:electron_app
e d gn check out/Default //electron/shell/common:mojo
e d gn check out/Default //electron/shell/common:plugin
# Check the hunspell filenames
node electron/script/gen-hunspell-filenames.js --check
node electron/script/gen-libc++-filenames.js --check
done
- name: Wait for active SSH sessions
if: always() && !cancelled()
shell: bash
run: |
while [ -f /var/.ssh-lock ]
do

View File

@@ -5,7 +5,7 @@ on:
inputs:
target-platform:
type: string
description: 'Platform to run on, can be macos or linux'
description: 'Platform to run on, can be macos, windows or linux'
required: true
target-arch:
type: string
@@ -41,22 +41,44 @@ env:
jobs:
test:
defaults:
run:
shell: bash
runs-on: ${{ inputs.test-runs-on }}
container: ${{ fromJSON(inputs.test-container) }}
strategy:
fail-fast: false
matrix:
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || fromJSON('["linux"]') }}
shard: ${{ inputs.target-platform == 'macos' && fromJSON('[1, 2]') || fromJSON('[1, 2, 3]') }}
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'windows' && fromJSON('["windows"]') || fromJSON('["linux"]')) }}
shard: ${{ inputs.target-platform == 'linux' && fromJSON('[1, 2, 3]') || fromJSON('[1, 2]') }}
env:
BUILD_TYPE: ${{ matrix.build-type }}
TARGET_ARCH: ${{ inputs.target-arch }}
ARTIFACT_KEY: ${{ matrix.build-type }}_${{ inputs.target-arch }}
steps:
- name: Fix node20 on arm32 runners
if: ${{ inputs.target-arch == 'arm' }}
if: ${{ inputs.target-arch == 'arm' && inputs.target-platform == 'linux' }}
run: |
cp $(which node) /mnt/runner-externals/node20/bin/
- name: Install Git on Windows arm64 runners
if: ${{ inputs.target-arch == 'arm64' && inputs.target-platform == 'windows' }}
shell: powershell
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install -y --no-progress git.install --params "'/GitAndUnixToolsOnPath'"
choco install -y --no-progress git
choco install -y --no-progress python --version 3.7.9
choco install -y --no-progress visualstudio2022buildtools --params '--quiet --wait --norestart --nocache --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.140 --add Microsoft.VisualStudio.Component.Windows11SDK.22000'
echo "C:\Program Files\Git\cmd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Python37" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Setup Node.js/npm
if: ${{ inputs.target-platform == 'windows' }}
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
with:
node-version: 20.11.x
- name: Add TCC permissions on macOS
if: ${{ inputs.target-platform == 'macos' }}
run: |
@@ -102,17 +124,12 @@ jobs:
- name: Get Depot Tools
timeout-minutes: 5
run: |
git config --global core.filemode false
git config --global core.autocrlf false
git config --global branch.autosetuprebase always
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
# Ensure depot_tools does not update.
test -d depot_tools && cd depot_tools
if [ "`uname`" = "Darwin" ]; then
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
sed -i '' '/ninjalog_uploader_wrapper.py/d' ./autoninja
else
sed -i '/ninjalog_uploader_wrapper.py/d' ./autoninja
# Remove swift-format dep from cipd on macOS until we send a patch upstream.
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
fi
touch .disable_auto_update
- name: Add Depot Tools to PATH
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
@@ -134,7 +151,17 @@ jobs:
path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
- name: Restore Generated Artifacts
run: ./src/electron/script/actions/restore-artifacts.sh
- name: Unzip Dist, Mksnapshot & Chromedriver
- name: Unzip Dist, Mksnapshot & Chromedriver (win)
if: ${{ inputs.target-platform == 'windows' }}
shell: powershell
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
cd src/out/Default
Expand-Archive -Force dist.zip -DestinationPath ./
Expand-Archive -Force chromedriver.zip -DestinationPath ./
Expand-Archive -Force mksnapshot.zip -DestinationPath ./
- name: Unzip Dist, Mksnapshot & Chromedriver (unix)
if: ${{ inputs.target-platform != 'windows' }}
run: |
cd src/out/Default
unzip -:o dist.zip
@@ -155,14 +182,19 @@ jobs:
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
DISPLAY: ':99.0'
NPM_CONFIG_MSVS_VERSION: '2022'
ELECTRON_ENABLE_LOGGING: '1'
run: |
cd src/electron
# Get which tests are on this shard
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'macos' && 2 || 3 }})
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'linux' && 3 || 2 }})
# Run tests
if [ "`uname`" = "Darwin" ]; then
if [ "${{ inputs.target-platform }}" != "linux" ]; then
echo "About to start tests"
if [ "${{ inputs.target-platform }}" = "windows" ] && [ "${{ inputs.target-arch }}" = "x86" ]; then
export npm_config_arch="ia32"
fi
node script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
else
chown :builduser .. && chmod g+w ..
@@ -194,6 +226,7 @@ jobs:
if-no-files-found: ignore
- name: Wait for active SSH sessions
if: always() && !cancelled()
shell: bash
run: |
while [ -f /var/.ssh-lock ]
do

View File

@@ -5,7 +5,7 @@ on:
inputs:
target-platform:
type: string
description: 'Platform to run on, can be macos or linux'
description: 'Platform to run on, can be macos, windows or linux'
required: true
target-arch:
type: string
@@ -93,6 +93,7 @@ jobs:
node electron/script/node-spec-runner.js --default --jUnitDir=junit
- name: Wait for active SSH sessions
if: always() && !cancelled()
shell: bash
run: |
while [ -f /var/.ssh-lock ]
do
@@ -155,6 +156,7 @@ jobs:
cd src
node electron/script/nan-spec-runner.js
- name: Wait for active SSH sessions
shell: bash
if: always() && !cancelled()
run: |
while [ -f /var/.ssh-lock ]

1
.gitignore vendored
View File

@@ -48,7 +48,6 @@ ts-gen
# Used to accelerate CI builds
.depshash
.depshash-target
# Used to accelerate builds after sync
patches/mtime-cache.json

View File

@@ -59,7 +59,7 @@ def skip_path(dep, dist_zip, target_cpu):
and dep == "snapshot_blob.bin"
)
)
if should_skip:
if should_skip and os.environ.get('ELECTRON_DEBUG_ZIP_SKIP') == '1':
print("Skipping {}".format(dep))
return should_skip

View File

@@ -1,6 +1,8 @@
#!/bin/bash
if [ "`uname`" == "Darwin" ]; then
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
BUILD_TYPE="windows"
elif [ "`uname`" == "Darwin" ]; then
if [ -z "$MAS_BUILD" ]; then
BUILD_TYPE="darwin"
else
@@ -46,23 +48,47 @@ cp_if_exist() {
move_src_dirs_if_exist() {
mkdir src_artifacts
for dir in \
src/out/Default/gen/node_headers \
src/out/Default/overlapped-checker \
src/out/Default/ffmpeg \
src/out/Default/hunspell_dictionaries \
src/third_party/electron_node \
src/third_party/nan \
src/cross-arch-snapshots \
src/third_party/llvm-build \
src/build/linux \
src/buildtools/mac \
src/buildtools/third_party/libc++ \
src/buildtools/third_party/libc++abi \
src/third_party/libc++ \
src/third_party/libc++abi \
src/out/Default/obj/buildtools/third_party \
src/v8/tools/builtins-pgo
dirs=("src/out/Default/gen/node_headers" \
"src/out/Default/overlapped-checker" \
"src/out/Default/ffmpeg" \
"src/out/Default/hunspell_dictionaries" \
"src/third_party/electron_node" \
"src/third_party/nan" \
"src/cross-arch-snapshots" \
"src/buildtools/mac" \
"src/buildtools/third_party/libc++" \
"src/buildtools/third_party/libc++abi" \
"src/third_party/libc++" \
"src/third_party/libc++abi" \
"src/out/Default/obj/buildtools/third_party" \
"src/v8/tools/builtins-pgo")
# Only do this for linux build type, this folder
# exists for windows builds on linux hosts but we do
# 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
if [ -d "$dir" ]; then
mkdir -p src_artifacts/$(dirname $dir)
@@ -70,7 +96,7 @@ move_src_dirs_if_exist() {
fi
done
tar -C src_artifacts -cf src_artifacts.tar ./
tar -C src_artifacts -cf src_artifacts.tar .
echo Storing src_artifacts.tar
mv src_artifacts.tar $SRC_ARTIFACTS

View File

@@ -2,21 +2,19 @@ const crypto = require('node:crypto');
const fs = require('node:fs');
const path = require('node:path');
// Fallback to blow away old cache keys
const FALLBACK_HASH_VERSION = 3;
// Per platform hash versions to bust the cache on different platforms
const HASH_VERSIONS = {
darwin: 3,
darwin: 4,
win32: 4,
linux: 3
linux: 4
};
// Base files to hash
const filesToHash = [
path.resolve(__dirname, '../DEPS'),
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) => {
@@ -38,7 +36,7 @@ const hasher = crypto.createHash('SHA256');
const addToHashAndLog = (s) => {
return hasher.update(s);
};
addToHashAndLog(`HASH_VERSION:${HASH_VERSIONS[process.platform] || FALLBACK_HASH_VERSION}`);
addToHashAndLog(`HASH_VERSION:${HASH_VERSIONS[process.platform]}`);
for (const file of filesToHash) {
hasher.update(fs.readFileSync(file));
}
@@ -47,15 +45,5 @@ for (const file of filesToHash) {
const extraArgs = process.env.GCLIENT_EXTRA_ARGS || 'no_extra_args';
addToHashAndLog(extraArgs);
const effectivePlatform = extraArgs.includes('host_os=mac') ? 'darwin' : process.platform;
// Write the hash to disk
fs.writeFileSync(path.resolve(__dirname, '../.depshash'), hasher.digest('hex'));
let targetContent = `${effectivePlatform}\n${process.env.TARGET_ARCH}\n${process.env.GN_CONFIG}\n${undefined}\n${process.env.GN_EXTRA_ARGS}\n${process.env.GN_BUILDFLAG_ARGS}`;
const argsDir = path.resolve(__dirname, '../build/args');
for (const argFile of fs.readdirSync(argsDir).sort()) {
targetContent += `\n${argFile}--${crypto.createHash('SHA1').update(fs.readFileSync(path.resolve(argsDir, argFile))).digest('hex')}`;
}
fs.writeFileSync(path.resolve(__dirname, '../.depshash-target'), targetContent);

View File

@@ -31,9 +31,9 @@ async function main () {
const outDir = utils.getOutDir({ shouldLog: true });
const nodeDir = path.resolve(BASE, 'out', outDir, 'gen', 'node_headers');
const env = {
npm_config_msvs_version: '2022',
...process.env,
npm_config_nodedir: nodeDir,
npm_config_msvs_version: '2022',
npm_config_arch: process.env.NPM_CONFIG_ARCH,
npm_config_yes: 'true'
};

View File

@@ -191,9 +191,9 @@ async function runMainProcessElectronTests () {
async function installSpecModules (dir) {
const env = {
npm_config_msvs_version: '2022',
...process.env,
CXXFLAGS: process.env.CXXFLAGS,
npm_config_msvs_version: '2022',
npm_config_yes: 'true'
};
if (args.electronVersion) {

View File

@@ -623,7 +623,9 @@ describe('chromium features', () => {
expect(size).to.be.a('number');
});
it('should lock the keyboard', async () => {
// TODO: Re-enable for windows on GitHub Actions,
// fullscreen tests seem to hang on GHA specifically
ifit(process.platform !== 'win32')('should lock the keyboard', async () => {
const w = new BrowserWindow({ show: true });
await w.loadFile(path.join(fixturesPath, 'pages', 'modal.html'));
@@ -2872,7 +2874,9 @@ describe('iframe using HTML fullscreen API while window is OS-fullscreened', ()
server.close();
});
ifit(process.platform !== 'darwin')('can fullscreen from out-of-process iframes (non-macOS)', async () => {
// TODO: Re-enable for windows on GitHub Actions,
// fullscreen tests seem to hang on GHA specifically
ifit(process.platform !== 'darwin' && process.platform !== 'win32')('can fullscreen from out-of-process iframes (non-macOS)', async () => {
const fullscreenChange = once(ipcMain, 'fullscreenChange');
const html =
`<iframe style="width: 0" frameborder=0 src="${crossSiteUrl}" allowfullscreen></iframe>`;
@@ -2924,7 +2928,9 @@ describe('iframe using HTML fullscreen API while window is OS-fullscreened', ()
});
// TODO(jkleinsc) fix this flaky test on WOA
ifit(process.platform !== 'win32' || process.arch !== 'arm64')('can fullscreen from in-process iframes', async () => {
// TODO: Re-enable for windows on GitHub Actions,
// fullscreen tests seem to hang on GHA specifically
ifit(process.platform !== 'win32')('can fullscreen from in-process iframes', async () => {
if (process.platform === 'darwin') await once(w, 'enter-full-screen');
const fullscreenChange = once(ipcMain, 'fullscreenChange');

View File

@@ -125,7 +125,7 @@ app.whenReady().then(async () => {
const validTestPaths = argv.files && argv.files.map(file =>
path.isAbsolute(file)
? path.relative(baseElectronDir, file)
: file);
: path.normalize(file));
const filter = (file) => {
if (!/-spec\.[tj]s$/.test(file)) {
return false;