From 06481b5630d4e5d978665db925c19442fa823589 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Wed, 13 Dec 2017 14:42:01 -0500 Subject: [PATCH] Add testing for arm, arm64 and ia32 linux builds --- .circleci/config.yml | 116 +++++++++++++++++++++++++++++++++++++++++- .dockerignore | 1 + Dockerfile.arm64 | 35 +++++++++++++ Dockerfile.armv7 | 41 +++++++++++++++ script/get-version.py | 11 ++++ tools/run-electron.sh | 4 ++ 6 files changed, 206 insertions(+), 2 deletions(-) create mode 100644 Dockerfile.arm64 create mode 100644 Dockerfile.armv7 create mode 100755 script/get-version.py create mode 100644 tools/run-electron.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index a4e3c4697ec8..81b6b163551c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,6 +58,46 @@ jobs: else echo 'Skipping upload distribution because build is not for release' fi + - run: + name: Zip out directory + command: | + if [ "$ELECTRON_RELEASE" != "1" ]; then + zip -r electron.zip out/D + fi + - persist_to_workspace: + root: /home/builduser + paths: + - project/out + - store_artifacts: + path: electron.zip + electron-linux-arm-test: + machine: true + steps: + - attach_workspace: + at: /tmp/workspace + - checkout + - run: + name: Test in ARM docker container + command: | + if [ "$ELECTRON_RELEASE" != "1" ]; then + docker run --rm --privileged multiarch/qemu-user-static:register --reset + docker run -it \ + --mount type=bind,source=/tmp/workspace,target=/tmp/workspace \ + --rm electronbuilds/electronarm7:0.0.4 > version.txt + cat version.txt + if grep -q `script/get-version.py` version.txt; then + echo "Versions match" + else + echo "Versions do not match" + exit 1 + fi + if grep -q "core dumped" version.txt; then + echo "Core dump detected" + exit 1 + fi + else + echo "Skipping test for release build" + fi electron-linux-arm64: docker: - image: electronbuilds/electron:0.0.4 @@ -115,6 +155,46 @@ jobs: else echo 'Skipping upload distribution because build is not for release' fi + - run: + name: Zip out directory + command: | + if [ "$ELECTRON_RELEASE" != "1" ]; then + zip -r electron.zip out/D + fi + - persist_to_workspace: + root: /home/builduser + paths: + - project/out + - store_artifacts: + path: electron.zip + electron-linux-arm64-test: + machine: true + steps: + - attach_workspace: + at: /tmp/workspace + - checkout + - run: + name: Test in ARM64 docker container + command: | + if [ "$ELECTRON_RELEASE" != "1" ]; then + docker run --rm --privileged multiarch/qemu-user-static:register --reset + docker run -it \ + --mount type=bind,source=/tmp/workspace,target=/tmp/workspace \ + --rm electronbuilds/electronarm64:0.0.5 > version.txt + cat version.txt + if grep -q `script/get-version.py` version.txt; then + echo "Versions match" + else + echo "Versions do not match" + exit 1 + fi + if grep -q "core dumped" version.txt; then + echo "Core dump detected" + exit 1 + fi + else + echo "Skipping test for release build" + fi electron-linux-ia32: docker: - image: electronbuilds/electron:0.0.4 @@ -123,6 +203,9 @@ jobs: resource_class: xlarge steps: - checkout + - run: + name: Setup for headless testing + command: sh -e /etc/init.d/xvfb start - run: name: Check for release command: | @@ -172,6 +255,29 @@ jobs: else echo 'Skipping upload distribution because build is not for release' fi + - run: + name: Test + environment: + MOCHA_FILE: junit/test-results.xml + MOCHA_REPORTER: mocha-junit-reporter + command: | + if [ "$ELECTRON_RELEASE" != "1" ]; then + echo 'Testing Electron debug build' + out/D/electron --version + mkdir junit + script/test.py --ci --rebuild_native_modules + else + echo 'Skipping testing on release build' + fi + - run: + name: Verify FFmpeg + command: | + if [ "$ELECTRON_RELEASE" != "1" ]; then + echo 'Verifying ffmpeg on debug build' + script/verify-ffmpeg.py + else + echo 'Skipping verify ffmpeg on release build' + fi electron-linux-mips64el: docker: - image: electronbuilds/electron:0.0.4 @@ -330,12 +436,18 @@ workflows: build-arm: jobs: - electron-linux-arm + - electron-linux-arm-test: + requires: + - electron-linux-arm build-arm64: jobs: - electron-linux-arm64 + - electron-linux-arm64-test: + requires: + - electron-linux-arm64 build-ia32: jobs: - electron-linux-ia32 build-x64: - jobs: - - electron-linux-x64 + jobs: + - electron-linux-x64 diff --git a/.dockerignore b/.dockerignore index 7307e769482a..2e67a161a980 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ * !tools/xvfb-init.sh +!tools/run-electron.sh diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 new file mode 100644 index 000000000000..6f99b2397111 --- /dev/null +++ b/Dockerfile.arm64 @@ -0,0 +1,35 @@ +FROM multiarch/debian-debootstrap:arm64-jessie + +RUN apt-get update && apt-get install -y\ + bison \ + build-essential \ + clang \ + curl \ + gperf \ + libasound2 \ + libasound2-dev \ + libcap-dev \ + libcups2-dev \ + libdbus-1-dev \ + libgconf-2-4 \ + libgconf2-dev \ + libgnome-keyring-dev \ + libgtk-3-0 \ + libgtk2.0-0 \ + libgtk2.0-dev \ + libnotify-dev \ + libnss3 \ + libnss3-dev \ + libx11-xcb-dev \ + libxss1 \ + libxtst-dev \ + libxtst6 \ + python-dbusmock \ + wget \ + xvfb + +ADD tools/xvfb-init.sh /etc/init.d/xvfb +RUN chmod a+x /etc/init.d/xvfb +ADD tools/run-electron.sh /run-electron.sh +RUN chmod a+x /run-electron.sh +CMD sh /run-electron.sh diff --git a/Dockerfile.armv7 b/Dockerfile.armv7 new file mode 100644 index 000000000000..3229fd4be65b --- /dev/null +++ b/Dockerfile.armv7 @@ -0,0 +1,41 @@ +FROM multiarch/debian-debootstrap:armhf-jessie + +RUN apt-get update && apt-get install -y\ + bison \ + build-essential \ + clang \ + curl \ + gperf \ + libasound2 \ + libasound2-dev \ + libcap-dev \ + libcups2-dev \ + libdbus-1-dev \ + libgconf-2-4 \ + libgconf2-dev \ + libgnome-keyring-dev \ + libgtk-3-0 \ + libgtk2.0-0 \ + libgtk2.0-dev \ + libnotify-dev \ + libnss3 \ + libnss3-dev \ + libx11-xcb-dev \ + libxss1 \ + libxtst-dev \ + libxtst6 \ + python-dbusmock \ + git \ + wget \ + xvfb + +# Install node.js +RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - +RUN apt-get update && apt-get install -y nodejs + +ADD tools/xvfb-init.sh /etc/init.d/xvfb +RUN chmod a+x /etc/init.d/xvfb +ADD tools/run-electron.sh /run-electron.sh +RUN chmod a+x /run-electron.sh + +CMD sh /run-electron.sh diff --git a/script/get-version.py b/script/get-version.py new file mode 100755 index 000000000000..fd94dbe647fd --- /dev/null +++ b/script/get-version.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +import sys + +from lib.util import get_electron_version + +def main(): + print get_electron_version() + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/run-electron.sh b/tools/run-electron.sh new file mode 100644 index 000000000000..47b191d04f6e --- /dev/null +++ b/tools/run-electron.sh @@ -0,0 +1,4 @@ +export DISPLAY=":99.0" +sh -e /etc/init.d/xvfb start +cd /tmp/workspace/project/ +out/D/electron --version