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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: run on circle hosts for forks #39858

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ jobs:
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/main/install.sh | DESTDIR=$CIRCLECI_BINARY bash
node build.js
name: Pack config.yml
- run:
name: Set params
command: node .circleci/config/params.js
- continuation/continue:
configuration_path: .circleci/config-staging/built.yml
parameters: /tmp/pipeline-parameters.json
Expand Down
23 changes: 14 additions & 9 deletions .circleci/config/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ parameters:
type: enum
default: all
enum: ["all", "osx-x64", "osx-arm64", "mas-x64", "mas-arm64"]

large-linux-executor:
type: enum
default: electronjs/aks-linux-large
enum: ["electronjs/aks-linux-large", "2xlarge"]

# Executors
executors:
Expand All @@ -42,9 +47,9 @@ executors:
size:
description: "Docker executor size"
type: enum
# aks-linux-medium === 8 core (32 core host, shared with other builds)
# aks-linux-large === 32 core
enum: ["medium", "xlarge", "electronjs/aks-linux-medium", "electronjs/aks-linux-large"]
# 2xlarge should not be used directly, use the pipeline param instead
enum: ["medium", "xlarge", "electronjs/aks-linux-large", "2xlarge"]
docker:
- image: ghcr.io/electron/build:e6bebd08a51a0d78ec23e5b3fd7e7c0846412328
resource_class: << parameters.size >>
Expand Down Expand Up @@ -1703,7 +1708,7 @@ jobs:
linux-x64-testing:
executor:
name: linux-docker
size: electronjs/aks-linux-large
size: << pipeline.parameters.large-linux-executor >>
environment:
<<: *env-global
<<: *env-testing-build
Expand All @@ -1720,7 +1725,7 @@ jobs:
linux-x64-testing-asan:
executor:
name: linux-docker
size: electronjs/aks-linux-large
size: << pipeline.parameters.large-linux-executor >>
environment:
<<: *env-global
<<: *env-testing-build
Expand Down Expand Up @@ -1749,7 +1754,7 @@ jobs:
linux-x64-publish:
executor:
name: linux-docker
size: electronjs/aks-linux-large
size: << pipeline.parameters.large-linux-executor >>
environment:
<<: *env-linux-2xlarge-release
<<: *env-release-build
Expand All @@ -1772,7 +1777,7 @@ jobs:
linux-arm-testing:
executor:
name: linux-docker
size: electronjs/aks-linux-large
size: << pipeline.parameters.large-linux-executor >>
environment:
<<: *env-global
<<: *env-arm
Expand All @@ -1792,7 +1797,7 @@ jobs:
linux-arm-publish:
executor:
name: linux-docker
size: electronjs/aks-linux-large
size: << pipeline.parameters.large-linux-executor >>
environment:
<<: *env-linux-2xlarge-release
<<: *env-arm
Expand All @@ -1817,7 +1822,7 @@ jobs:
linux-arm64-testing:
executor:
name: linux-docker
size: electronjs/aks-linux-large
size: << pipeline.parameters.large-linux-executor >>
environment:
<<: *env-global
<<: *env-arm64
Expand Down Expand Up @@ -1848,7 +1853,7 @@ jobs:
linux-arm64-publish:
executor:
name: linux-docker
size: electronjs/aks-linux-large
size: << pipeline.parameters.large-linux-executor >>
environment:
<<: *env-linux-2xlarge-release
<<: *env-arm64
Expand Down
11 changes: 11 additions & 0 deletions .circleci/config/params.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const fs = require('fs');

const PARAMS_PATH = '/tmp/pipeline-parameters.json';

const content = JSON.parse(fs.readFileSync(PARAMS_PATH, 'utf-8'));

// Choose resource class for linux hosts
const currentBranch = process.env.CIRCLE_BRANCH || '';
content['large-linux-executor'] = /^pull\/[0-9-]+$/.test(currentBranch) ? '2xlarge' : 'electronjs/aks-linux-large';

fs.writeFileSync(PARAMS_PATH, JSON.stringify(content));