2023-06-05 23:41:55 +03:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
orbs:
|
2024-11-02 05:59:06 +03:00
|
|
|
node: electronjs/node@2.3.1
|
2023-06-05 23:41:55 +03:00
|
|
|
|
2024-11-02 04:43:54 +03:00
|
|
|
executors:
|
|
|
|
linux-medium-plus:
|
|
|
|
docker:
|
|
|
|
- image: cimg/base:stable
|
|
|
|
resource_class: medium+
|
|
|
|
|
2023-06-05 23:41:55 +03:00
|
|
|
commands:
|
|
|
|
install:
|
|
|
|
steps:
|
|
|
|
- run: git config --global core.autocrlf input
|
|
|
|
- node/install:
|
2024-09-19 03:59:28 +03:00
|
|
|
node-version: '18.20.3'
|
2023-06-05 23:41:55 +03:00
|
|
|
- checkout
|
2023-08-29 23:18:37 +03:00
|
|
|
run-lint-and-build:
|
2023-06-05 23:41:55 +03:00
|
|
|
steps:
|
2023-08-03 23:13:56 +03:00
|
|
|
- node/install-packages
|
2023-06-05 23:41:55 +03:00
|
|
|
- run:
|
2023-08-29 23:18:37 +03:00
|
|
|
name: 'Lint codebase'
|
2023-06-05 23:41:55 +03:00
|
|
|
command: |
|
|
|
|
yarn lint
|
|
|
|
yarn syncpack
|
2023-08-29 23:18:37 +03:00
|
|
|
- run:
|
|
|
|
name: 'Build Electron Forge'
|
|
|
|
command: |
|
2023-06-05 23:41:55 +03:00
|
|
|
yarn build
|
2023-08-29 23:18:37 +03:00
|
|
|
run-fast-tests:
|
|
|
|
steps:
|
2023-09-15 01:12:58 +03:00
|
|
|
- node/install-packages:
|
|
|
|
with-cache: false
|
2023-08-29 23:18:37 +03:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: 'Run fast tests'
|
|
|
|
command: |
|
2023-06-05 23:41:55 +03:00
|
|
|
yarn test:fast
|
2023-08-29 23:18:37 +03:00
|
|
|
|
2023-06-05 23:41:55 +03:00
|
|
|
run-slow-tests:
|
|
|
|
steps:
|
2023-09-15 01:12:58 +03:00
|
|
|
- node/install-packages:
|
|
|
|
with-cache: false
|
2023-08-29 23:18:37 +03:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2023-06-05 23:41:55 +03:00
|
|
|
- run:
|
2023-08-29 23:18:37 +03:00
|
|
|
name: 'Run slow tests'
|
2023-06-05 23:41:55 +03:00
|
|
|
command: |
|
2023-08-29 23:18:37 +03:00
|
|
|
echo $(circleci tests glob "packages/**/*_spec_slow.ts")
|
|
|
|
TEST_GLOB=$(circleci tests glob "packages/**/*_spec_slow.ts" | circleci tests split --split-by=timings)
|
|
|
|
yarn test $TEST_GLOB
|
2023-06-05 23:41:55 +03:00
|
|
|
|
|
|
|
jobs:
|
2023-08-29 23:18:37 +03:00
|
|
|
lint-and-build:
|
|
|
|
executor: node/linux
|
|
|
|
steps:
|
|
|
|
- install
|
|
|
|
- run-lint-and-build
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- packages/*/*/dist/*
|
|
|
|
|
2023-06-05 23:41:55 +03:00
|
|
|
fast-tests:
|
|
|
|
parameters:
|
2023-08-03 23:13:56 +03:00
|
|
|
executor:
|
2023-06-05 23:41:55 +03:00
|
|
|
type: string
|
|
|
|
arch:
|
|
|
|
type: enum
|
|
|
|
enum: ['x64', 'arm64']
|
2023-08-03 23:13:56 +03:00
|
|
|
executor: << parameters.executor >>
|
2023-06-05 23:41:55 +03:00
|
|
|
steps:
|
|
|
|
- install
|
2024-09-19 03:59:28 +03:00
|
|
|
- when:
|
|
|
|
condition:
|
|
|
|
equal: [node/windows, << parameters.executor >>]
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Windows Setup
|
|
|
|
shell: bash
|
|
|
|
command: |
|
|
|
|
pip install setuptools
|
|
|
|
cd 'C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script'
|
|
|
|
npm install node-gyp@9.4.0
|
2023-06-05 23:41:55 +03:00
|
|
|
- when:
|
|
|
|
condition:
|
2023-08-03 23:13:56 +03:00
|
|
|
equal: [node/linux, << parameters.executor >>]
|
2023-06-05 23:41:55 +03:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Linux specific setup
|
|
|
|
command: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y \
|
|
|
|
--no-install-recommends \
|
|
|
|
xvfb \
|
|
|
|
libnss3 \
|
|
|
|
libasound2 \
|
|
|
|
libatk1.0-0 \
|
|
|
|
libatk-bridge2.0-0 \
|
|
|
|
libgdk-pixbuf2.0-dev \
|
|
|
|
libgtk-3-0 \
|
|
|
|
libgbm1
|
|
|
|
sudo add-apt-repository -y ppa:alexlarsson/flatpak
|
|
|
|
- run-fast-tests
|
2023-08-23 20:26:26 +03:00
|
|
|
- store_test_results:
|
|
|
|
path: ./reports/
|
2023-06-05 23:41:55 +03:00
|
|
|
slow-tests:
|
|
|
|
parameters:
|
2023-08-03 23:13:56 +03:00
|
|
|
executor:
|
2023-06-05 23:41:55 +03:00
|
|
|
type: string
|
|
|
|
arch:
|
|
|
|
type: enum
|
|
|
|
enum: ['x64', 'arm64']
|
2023-08-03 23:13:56 +03:00
|
|
|
executor: << parameters.executor >>
|
2023-08-29 23:18:37 +03:00
|
|
|
parallelism: 2
|
2023-06-05 23:41:55 +03:00
|
|
|
steps:
|
|
|
|
- install
|
|
|
|
- when:
|
|
|
|
condition:
|
2023-08-03 23:13:56 +03:00
|
|
|
equal: [node/windows, << parameters.executor >>]
|
2023-06-05 23:41:55 +03:00
|
|
|
steps:
|
2023-08-03 23:13:56 +03:00
|
|
|
- run:
|
2023-08-29 23:18:37 +03:00
|
|
|
name: Windows Setup
|
|
|
|
shell: bash
|
2023-08-03 23:13:56 +03:00
|
|
|
command: |
|
2024-09-19 03:59:28 +03:00
|
|
|
pip install setuptools
|
2024-03-06 23:39:46 +03:00
|
|
|
choco install --no-progress -y wixtoolset --version=3.14.0
|
|
|
|
echo 'export PATH=$PATH:"/C/Program Files (x86)/WiX Toolset v3.14/bin"' >> "$BASH_ENV"
|
2023-08-29 23:18:37 +03:00
|
|
|
cd 'C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script'
|
|
|
|
npm install node-gyp@9.4.0
|
2023-06-05 23:41:55 +03:00
|
|
|
- when:
|
|
|
|
condition:
|
2024-11-02 04:43:54 +03:00
|
|
|
equal: [linux-medium-plus, << parameters.executor >>]
|
2023-06-05 23:41:55 +03:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Linux specific setup
|
|
|
|
command: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y \
|
|
|
|
--no-install-recommends \
|
|
|
|
xvfb \
|
|
|
|
libnss3 \
|
|
|
|
libasound2 \
|
|
|
|
libatk1.0-0 \
|
|
|
|
libatk-bridge2.0-0 \
|
|
|
|
libgdk-pixbuf2.0-dev \
|
|
|
|
libgtk-3-0 \
|
|
|
|
libgbm1
|
2023-08-29 23:18:37 +03:00
|
|
|
- run-slow-tests
|
2023-08-31 00:52:38 +03:00
|
|
|
- run:
|
|
|
|
when: always # the report is generated on pass or fail
|
|
|
|
name: Make test report paths relative
|
|
|
|
command: |
|
|
|
|
if [ -e ./reports/out/test_output.xml ]; then
|
2024-06-07 21:04:19 +03:00
|
|
|
sed -i.bak 's/"[^"]*packages/"packages/' ./reports/out/test_output.xml
|
2023-08-31 00:52:38 +03:00
|
|
|
fi
|
2023-08-29 23:18:37 +03:00
|
|
|
- store_test_results:
|
|
|
|
path: ./reports/
|
2023-06-05 23:41:55 +03:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
tests:
|
|
|
|
jobs:
|
2023-08-29 23:18:37 +03:00
|
|
|
- lint-and-build
|
2023-06-05 23:41:55 +03:00
|
|
|
- fast-tests:
|
2023-08-29 23:18:37 +03:00
|
|
|
requires:
|
|
|
|
- lint-and-build
|
2023-06-05 23:41:55 +03:00
|
|
|
matrix:
|
|
|
|
parameters:
|
2023-08-03 23:13:56 +03:00
|
|
|
executor: [node/windows, node/linux, node/macos]
|
2023-06-05 23:41:55 +03:00
|
|
|
arch: [x64, arm64]
|
|
|
|
exclude:
|
2023-08-03 23:13:56 +03:00
|
|
|
- executor: node/windows
|
2023-06-05 23:41:55 +03:00
|
|
|
arch: arm64
|
2023-08-03 23:13:56 +03:00
|
|
|
- executor: node/linux
|
2023-06-05 23:41:55 +03:00
|
|
|
arch: arm64
|
|
|
|
- slow-tests:
|
2023-08-29 23:18:37 +03:00
|
|
|
requires:
|
|
|
|
- lint-and-build
|
2023-06-05 23:41:55 +03:00
|
|
|
matrix:
|
|
|
|
parameters:
|
2024-11-02 04:43:54 +03:00
|
|
|
executor: [node/windows, linux-medium-plus, node/macos]
|
2023-06-05 23:41:55 +03:00
|
|
|
arch: [x64, arm64]
|
|
|
|
exclude:
|
2023-08-03 23:13:56 +03:00
|
|
|
- executor: node/windows
|
2023-06-05 23:41:55 +03:00
|
|
|
arch: arm64
|
2024-11-02 04:43:54 +03:00
|
|
|
- executor: linux-medium-plus
|
2023-06-05 23:41:55 +03:00
|
|
|
arch: arm64
|