From 06f1e7dc301f8ff3c971b2348647f785f96873bc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Nov 2022 00:55:16 +0000 Subject: [PATCH 1/5] chore(deps): lock file maintenance --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5b31cec..334b19e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,9 +23,9 @@ integrity sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A== prettier@^2.1.2: - version "2.7.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" - integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== + version "2.8.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.0.tgz#c7df58393c9ba77d6fba3921ae01faf994fb9dc9" + integrity sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA== tunnel@^0.0.6: version "0.0.6" From 31e91de0f8654375a21e8e83078be625380e2b18 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 00:25:40 +0000 Subject: [PATCH 2/5] chore(deps): lock file maintenance --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 334b19e..12e17da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,9 +23,9 @@ integrity sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A== prettier@^2.1.2: - version "2.8.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.0.tgz#c7df58393c9ba77d6fba3921ae01faf994fb9dc9" - integrity sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA== + version "2.8.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc" + integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg== tunnel@^0.0.6: version "0.0.6" From ac5a94235118c1f7c367df5c462a21084cbd38b4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Jan 2023 15:42:26 +0100 Subject: [PATCH 3/5] chore(deps): update dependency @vercel/ncc to ^0.36.0 (#27) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 81e9f9e..0add1ad 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "ncc build index.js" }, "devDependencies": { - "@vercel/ncc": "^0.34.0", + "@vercel/ncc": "^0.36.0", "prettier": "^2.1.2" }, "dependencies": { diff --git a/yarn.lock b/yarn.lock index 12e17da..9a17811 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,10 +17,10 @@ dependencies: tunnel "^0.0.6" -"@vercel/ncc@^0.34.0": - version "0.34.0" - resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.34.0.tgz#d0139528320e46670d949c82967044a8f66db054" - integrity sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A== +"@vercel/ncc@^0.36.0": + version "0.36.0" + resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.36.0.tgz#1f262b86fc4f0770bbc0fc1d331d5aaa1bd47334" + integrity sha512-/ZTUJ/ZkRt694k7KJNimgmHjtQcRuVwsST2Z6XfYveQIuBbHR+EqkTc1jfgPkQmMyk/vtpxo3nVxe8CNuau86A== prettier@^2.1.2: version "2.8.1" From c602f2ba212244ed3bda4a156ec2cba56b403bf7 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 6 Jan 2023 15:42:03 +0100 Subject: [PATCH 4/5] feat: use `os.availableParallelism` if available --- README.md | 2 +- dist/index.js | 9 +++++++-- index.js | 9 +++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dec7e57..952e993 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # github-actions-cpu-cores -Uses [`os.cpus`](https://nodejs.org/api/os.html#os_os_cpus) to figure out how many logical cores are available on the runner. +Uses [`os.availableParallelism`](https://nodejs.org/api/os.html#osavailableparallelism) (or [`os.cpus`](https://nodejs.org/api/os.html#os_os_cpus) if `availableParallelism` is unavailable) to figure out how many logical cores are available on the runner. ```yaml name: Node CI diff --git a/dist/index.js b/dist/index.js index b6b3d74..3ef22e7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2817,10 +2817,15 @@ module.exports = require("util"); var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { -const { cpus } = __nccwpck_require__(37); +const os = __nccwpck_require__(37); const core = __nccwpck_require__(186); -core.setOutput("count", cpus().length); +const numberOfCpus = + typeof os.availableParallelism === "function" + ? os.availableParallelism() + : os.cpus().length; + +core.setOutput("count", numberOfCpus); })(); diff --git a/index.js b/index.js index 09aa813..76aa7ac 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,9 @@ -const { cpus } = require("os"); +const os = require("os"); const core = require("@actions/core"); -core.setOutput("count", cpus().length); +const numberOfCpus = + typeof os.availableParallelism === "function" + ? os.availableParallelism() + : os.cpus().length; + +core.setOutput("count", numberOfCpus); From 410541432439795d30db6501fb1d8178eb41e502 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 6 Jan 2023 15:47:09 +0100 Subject: [PATCH 5/5] 1.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0add1ad..4a12e46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-actions-cpu-cores", - "version": "1.0.2", + "version": "1.1.0", "main": "index.js", "license": "MIT", "scripts": {