UNPKG

@knapsack-pro/core

Version:

Knapsack Pro Core library splits tests across CI nodes and makes sure that tests will run in optimal time on each CI node. This library gives core features like communication with KnapsackPro.com API. This library is a dependency for other projects specif

40 lines (39 loc) 1.13 kB
import { CIProviderBase } from './index.js'; export class SemaphoreCI2 extends CIProviderBase { static get ciNodeTotal() { return process.env.SEMAPHORE_JOB_COUNT; } static get ciNodeIndex() { const jobIndex = process.env.SEMAPHORE_JOB_INDEX; if (jobIndex) { return (parseInt(jobIndex, 10) - 1).toString(); } } static get ciNodeBuildId() { return process.env.SEMAPHORE_WORKFLOW_ID; } static get ciNodeRetryCount() { return undefined; } static get commitHash() { return process.env.SEMAPHORE_GIT_SHA; } static get branch() { return (process.env.SEMAPHORE_GIT_WORKING_BRANCH || process.env.SEMAPHORE_GIT_BRANCH); } static get userSeat() { return process.env.SEMAPHORE_GIT_COMMITTER; } static get detect() { return 'SEMAPHORE' in process.env && 'SEMAPHORE_WORKFLOW_ID' in process.env ? this : null; } static get fixedQueueSplit() { return false; } static get ciProvider() { return 'Semaphore CI 2.0'; } }