Skip to content

Commit

Permalink
ci: use electronjs/node orb (#3289)
Browse files Browse the repository at this point in the history
* ci: use electronjs/node orb

* ci: fix parameter type

* ci: CircleCI why
  • Loading branch information
dsanders11 authored Aug 3, 2023
1 parent 48c67f3 commit e7eccc1
Showing 1 changed file with 33 additions and 60 deletions.
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

0 comments on commit e7eccc1

Please sign in to comment.