Skip to content

Number of cores as env/context variable ? #25057

Answered by BrightRan
mellery451 asked this question in Actions
Discussion options

You must be logged in to vote

GitHub seems has no predefined environment variables or contexts to get the number of cores.

As a workaround, you can run the following commands on each OS to view the number of cores:

On Windows:

WMIC CPU Get DeviceID,NumberOfCores,NumberOfLogicalProcessors

OR

WMIC CPU Get /Format:List

On Linux:

lscpu

OR

lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)'

On macOS:

system_profiler SPHardwareDataType

Then you can try to get the number from the output of the command, and set an output parameter with using the number as value.

In a workflow, The output parameter only can be used between the steps in a same job via the syntax  steps.<step_ID>.outputs.<out…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@urbasus
Comment options

@Kurt-von-Laven
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants