|
@@ -20,16 +20,10 @@ on:
|
|
|
description: 'JSON container information for aks runs-on'
|
|
|
required: false
|
|
|
default: '{"image":null}'
|
|
|
- gn-build-type:
|
|
|
- description: 'The gn build type - testing or release'
|
|
|
- required: true
|
|
|
- type: string
|
|
|
- default: testing
|
|
|
|
|
|
concurrency:
|
|
|
group: electron-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }}
|
|
|
- cancel-in-progress: true
|
|
|
-
|
|
|
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
|
|
env:
|
|
|
ELECTRON_OUT_DIR: Default
|
|
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
|
@@ -42,16 +36,11 @@ jobs:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || fromJSON('["linux"]') }}
|
|
|
+ shard: ${{ inputs.target-platform == 'macos' && fromJSON('[1]') || fromJSON('[1, 2, 3]') }}
|
|
|
env:
|
|
|
BUILD_TYPE: ${{ matrix.build-type }}
|
|
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
|
|
steps:
|
|
|
- - name: Load Build Tools
|
|
|
- run: |
|
|
|
- export BUILD_TOOLS_SHA=2f67e10b9b6b5700b1c7940df412b0345257d9ae
|
|
|
- npm i -g @electron/build-tools
|
|
|
- e auto-update disable
|
|
|
- e init --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
|
|
- name: Checkout Electron
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
|
|
|
with:
|
|
@@ -70,6 +59,9 @@ jobs:
|
|
|
sed -i '' '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
|
|
else
|
|
|
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
|
|
|
# Ensure depot_tools does not update.
|
|
|
test -d depot_tools && cd depot_tools
|
|
@@ -100,9 +92,6 @@ jobs:
|
|
|
# sudo security authorizationdb write com.apple.trust-settings.admin allow
|
|
|
# cd src/electron
|
|
|
# ./script/codesign/generate-identity.sh
|
|
|
- - name: Setup for headless testing
|
|
|
- if: ${{ inputs.target-platform == 'linux' }}
|
|
|
- run: sh -e /etc/init.d/xvfb start
|
|
|
- name: Run Electron Tests
|
|
|
env:
|
|
|
MOCHA_REPORTER: mocha-multi-reporters
|
|
@@ -110,9 +99,21 @@ jobs:
|
|
|
MOCHA_MULTI_REPORTERS: mocha-junit-reporter, tap
|
|
|
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
|
|
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
|
|
+ DISPLAY: ':99.0'
|
|
|
run: |
|
|
|
cd src/electron
|
|
|
- node script/yarn test --runners=main --trace-uncaught --enable-logging
|
|
|
+ # Get which tests are on this shard
|
|
|
+ tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'macos' && 1 || 3 }})
|
|
|
+
|
|
|
+ # Run tests
|
|
|
+ if [ "`uname`" = "Darwin" ]; then
|
|
|
+ node script/yarn test --runners=main --trace-uncaught --enable-logging
|
|
|
+ else
|
|
|
+ chown :builduser .. && chmod g+w ..
|
|
|
+ chown -R :builduser . && chmod -R g+w .
|
|
|
+ chmod 4755 ../out/Default/chrome-sandbox
|
|
|
+ runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
|
|
|
+ fi
|
|
|
- name: Wait for active SSH sessions
|
|
|
if: always() && !cancelled()
|
|
|
run: |
|