From 6b65dec66a90800d9505cf2233ae4a03e8eaaf50 Mon Sep 17 00:00:00 2001 From: Alex Moinet Date: Fri, 16 Aug 2024 10:38:06 +0100 Subject: [PATCH] Attempt to run electron pipeline in buildkite --- .buildkite/basic/electron-pipeline.yml | 82 +++++++++++++++++++++++++- docker-compose.yml | 13 ++++ dockerfiles/Dockerfile.electron | 24 ++++++++ 3 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 dockerfiles/Dockerfile.electron diff --git a/.buildkite/basic/electron-pipeline.yml b/.buildkite/basic/electron-pipeline.yml index cec5f9fb8..2d9b4cfd6 100644 --- a/.buildkite/basic/electron-pipeline.yml +++ b/.buildkite/basic/electron-pipeline.yml @@ -10,9 +10,6 @@ steps: env: NODE_VERSION: "{{matrix.node_version}}" ELECTRON_VERSION: "{{matrix.electron_version}}" - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" - START_LOCAL_NPM: "1" - VERBOSE: "1" matrix: setup: electron_version: @@ -32,3 +29,82 @@ steps: - defaults write com.apple.CrashReporter DialogType none - npm run test:unit:electron-runner - npm run test:electron + + # + # Ubuntu tests Node 18 + # + - label: ":docker: Build Electron {{matrix.electron_version}} ubuntu test image" + timeout_in_minutes: 10 + env: + ELECTRON_VERSION: "{{matrix.electron_version}}" + matrix: + setup: + electron_version: + - "^20.0.0" + - "^24.0.0" + - "^26.0.0" + - "^28.0.0" + - "^30.0.0" + plugins: + - docker-compose#v4.12.0: + build: + - electron-test-image + image-repository: 855461928731.dkr.ecr.us-west-1.amazonaws.com/js + cache-from: + - electron-test-image:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-electron-test-${BRANCH_NAME}-${matrix.electron_version} + - docker-compose#v4.12.0: + push: + - electron-ubuntu-test:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-electron-test-${BRANCH_NAME}-${matrix.electron_version} + + - label: "Electron {{matrix.electron_version}} linting" + timeout_in_minutes: 10 + env: + ELECTRON_VERSION: "{{matrix.electron_version}}" + matrix: + setup: + electron_version: + - "^20.0.0" + - "^24.0.0" + - "^26.0.0" + - "^28.0.0" + - "^30.0.0" + plugins: + - docker-compose#v4.12.0: + run: electron-test-image + command: npm run test:lint-native + + - label: "Electron {{matrix.electron_version}} unit tests" + timeout_in_minutes: 10 + env: + ELECTRON_VERSION: "{{matrix.electron_version}}" + matrix: + setup: + electron_version: + - "^20.0.0" + - "^24.0.0" + - "^26.0.0" + - "^28.0.0" + - "^30.0.0" + plugins: + - docker-compose#v4.12.0: + run: electron-test-image + command: npm run test:unit:electron-runner + + - label: "Electron {{matrix.electron_version}} integration tests" + timeout_in_minutes: 10 + env: + ELECTRON_VERSION: "{{matrix.electron_version}}" + matrix: + setup: + electron_version: + - "^20.0.0" + - "^24.0.0" + - "^26.0.0" + - "^28.0.0" + - "^30.0.0" + plugins: + - docker-compose#v4.12.0: + run: electron-test-image + command: npm run test:electron + artifact_paths: + - "test/electron/maze_output/**/*" diff --git a/docker-compose.yml b/docker-compose.yml index 5ff875448..86f040a65 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,6 +39,19 @@ services: context: . dockerfile: dockerfiles/Dockerfile.ci + electron-test-image: + build: + context: . + dockerfile: dockerfiles/Dockerfile.electron + environment: + <<: *common-environment + ELECTRON_VERSION: + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 + START_LOCAL_NPM: 1 + VERBOSE: 1 + volumes: + - ./test/electron/maze_output:/app/test/electron/maze_output + browser-maze-runner-bb: build: context: . diff --git a/dockerfiles/Dockerfile.electron b/dockerfiles/Dockerfile.electron new file mode 100644 index 000000000..7d667db7e --- /dev/null +++ b/dockerfiles/Dockerfile.electron @@ -0,0 +1,24 @@ +FROM node:18-bullseye + +RUN apt-get update && apt-get install -y \ + build-essential \ + xvfb \ + libnss3 \ + libatk1.0-0 \ + libatk-bridge2.0-0 \ + libgdk-pixbuf2.0-0 \ + libgtk-3-0 \ + libasound2 \ + libgbm1 + +COPY . /app +WORKDIR /app + +RUN npm install electron@$ELECTRON_VERSION --no-audit --progress=false --no-save +RUN npm ci --no-audit --progress=false + +RUN npx lerna bootstrap + +RUN npm run build:electron + +RUN apt-get install cppcheck -y