initial commit
This commit is contained in:
12
libraries/FastLED/ci/util/cpu_count.py
Normal file
12
libraries/FastLED/ci/util/cpu_count.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import os
|
||||
|
||||
|
||||
def cpu_count() -> int:
|
||||
"""Get the number of CPUs."""
|
||||
# Force sequential execution if NO_PARALLEL is set
|
||||
if "GITHUB_ACTIONS" in os.environ:
|
||||
return 1
|
||||
no_parallel = os.environ.get("NO_PARALLEL", "0") in ["1", "true", "True"]
|
||||
if no_parallel:
|
||||
return 1
|
||||
return os.cpu_count() or 1
|
||||
Reference in New Issue
Block a user