Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use electronjs/node orb #3289

Merged
merged 3 commits into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 33 additions & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,47 @@
version: 2.1

orbs:
node: circleci/[email protected]
win: circleci/[email protected]

executors:
linux:
docker:
- image: cimg/base:stable
macos:
macos:
xcode: '14.3.0'
resource_class: macos.x86.medium.gen2
windows:
machine:
image: windows-server-2022-gui:stable
resource_class: windows.medium
shell: bash
node: electronjs/[email protected]

commands:
install:
steps:
- run: git config --global core.autocrlf input
- node/install:
node-version: '18.15.0'
- run: nvm use 18.15.0
- checkout
- restore_cache:
name: Restore Cached Dependencies
keys:
- v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
- v1-dependencies-{{ arch }}
- run: npm install --global yarn
- save_cache:
name: Cache Installed Dependencies
paths:
- node_modules
key: v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
run-fast-tests:
steps:
- node/install-packages
- run:
command: |
yarn install
yarn lint
yarn syncpack
yarn build
yarn test:fast
run-slow-tests:
steps:
- node/install-packages
- run:
command: |
yarn install
yarn lint
yarn build
yarn test:slow

jobs:
fast-tests:
parameters:
platform:
executor:
type: string
arch:
type: enum
enum: ['x64', 'arm64']
executor: << parameters.platform >>
executor: << parameters.executor >>
steps:
- install
- when:
condition:
equal: ['linux', << parameters.platform >>]
equal: [node/linux, << parameters.executor >>]
steps:
- run:
name: Linux specific setup
Expand All @@ -88,37 +61,37 @@ jobs:
- run-fast-tests
slow-tests:
parameters:
platform:
executor:
type: string
arch:
type: enum
enum: ['x64', 'arm64']
executor: << parameters.platform >>
executor: << parameters.executor >>
steps:
- install
- when:
condition:
equal: ['windows', << parameters.platform >>]
equal: [node/windows, << parameters.executor >>]
steps:
run:
name: setup Windows and run slow tests
shell: powershell.exe -ExecutionPolicy Bypass
command: |
Write-Output "Installing WiX Toolset"
choco install --no-progress -y wixtoolset
Write-Output "Reloading PATH"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
[Environment]::SetEnvironmentVariable("PATH", $env:Path + "C:\Program Files (x86)\WiX Toolset v3.11\bin;", "Machine")
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
npm config set node-gyp "$CIRCLE_WORKING_DIRECTORY\node_modules\node-gyp\bin\node-gyp.js"
- node/install-packages
- run:
name: setup Windows and run slow tests
shell: powershell.exe -ExecutionPolicy Bypass
command: |
Write-Output "Installing WiX Toolset"
choco install --no-progress -y wixtoolset
Write-Output "Reloading PATH"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
[Environment]::SetEnvironmentVariable("PATH", $env:Path + "C:\Program Files (x86)\WiX Toolset v3.11\bin;", "Machine")
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
npm config set node-gyp "$CIRCLE_WORKING_DIRECTORY\node_modules\node-gyp\bin\node-gyp.js"

yarn install
yarn lint
yarn build
yarn test:slow
yarn lint
yarn build
yarn test:slow
- when:
condition:
equal: ['linux', << parameters.platform >>]
equal: [node/linux, << parameters.executor >>]
steps:
- run:
name: Linux specific setup
Expand All @@ -137,8 +110,8 @@ jobs:
- when:
condition:
or:
- equal: ['macos', << parameters.platform >>]
- equal: ['linux', << parameters.platform >>]
- equal: [node/macos, << parameters.executor >>]
- equal: [node/linux, << parameters.executor >>]
steps:
- run-slow-tests

Expand All @@ -148,20 +121,20 @@ workflows:
- fast-tests:
matrix:
parameters:
platform: [windows, linux, macos]
executor: [node/windows, node/linux, node/macos]
arch: [x64, arm64]
exclude:
- platform: windows
- executor: node/windows
arch: arm64
- platform: linux
- executor: node/linux
arch: arm64
- slow-tests:
matrix:
parameters:
platform: [windows, linux, macos]
executor: [node/windows, node/linux, node/macos]
arch: [x64, arm64]
exclude:
- platform: windows
- executor: node/windows
arch: arm64
- platform: linux
- executor: node/linux
arch: arm64