From a67fd2880d756b1f0ac8017b3317c2227f37d547 Mon Sep 17 00:00:00 2001 From: Patrick Roncagliolo Date: Mon, 9 Dec 2024 20:42:18 +0100 Subject: [PATCH 1/2] Do not run `apt update` if `skipRosdepInstall==true` Signed-off-by: Patrick Roncagliolo --- dist/index.js | 8 +++----- src/action-ros-ci.ts | 9 ++++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index 02dee7b3..82221bbf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -31173,7 +31173,9 @@ done`; yield execShellCommand(["vcs import --force --recursive src/ < package.repo"], options); // Print HEAD commits of all repos yield execShellCommand(["vcs log -l1 src/"], options); - if (isLinux) { + // rosdep does not really work on Windows, so do not use it + // See: https://github.com/ros-infrastructure/rosdep/issues/610 + if (!isWindows && !skipRosdepInstall) { // Always update package index before installing packages const dist = yield determineDistrib(); if (dist === "ubuntu") { @@ -31187,10 +31189,6 @@ done`; else { core.setFailed(`Unsupported distribution ${dist}`); } - } - // rosdep does not really work on Windows, so do not use it - // See: https://github.com/ros-infrastructure/rosdep/issues/610 - if (!isWindows && !skipRosdepInstall) { yield installRosdeps(buildPackageSelection, rosdepSkipKeysSelection, rosWorkspaceDir, options, targetRos1Distro, targetRos2Distro); } if (skipRosdepInstall && rosdepCheck) { diff --git a/src/action-ros-ci.ts b/src/action-ros-ci.ts index b84eb98c..bf9682ee 100644 --- a/src/action-ros-ci.ts +++ b/src/action-ros-ci.ts @@ -650,7 +650,9 @@ done`; // Print HEAD commits of all repos await execShellCommand(["vcs log -l1 src/"], options); - if (isLinux) { + // rosdep does not really work on Windows, so do not use it + // See: https://github.com/ros-infrastructure/rosdep/issues/610 + if (!isWindows && !skipRosdepInstall) { // Always update package index before installing packages const dist: string = await determineDistrib(); if (dist === "ubuntu") { @@ -662,10 +664,7 @@ done`; } else { core.setFailed(`Unsupported distribution ${dist}`); } - } - // rosdep does not really work on Windows, so do not use it - // See: https://github.com/ros-infrastructure/rosdep/issues/610 - if (!isWindows && !skipRosdepInstall) { + await installRosdeps( buildPackageSelection, rosdepSkipKeysSelection, From e417233be5d780e3302765750e250a021b1abe2a Mon Sep 17 00:00:00 2001 From: Patrick Roncagliolo Date: Mon, 9 Dec 2024 22:02:25 +0100 Subject: [PATCH 2/2] Implement review comments Signed-off-by: Patrick Roncagliolo --- dist/index.js | 8 +++++--- src/action-ros-ci.ts | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dist/index.js b/dist/index.js index 82221bbf..9ad9b771 100644 --- a/dist/index.js +++ b/dist/index.js @@ -31173,9 +31173,7 @@ done`; yield execShellCommand(["vcs import --force --recursive src/ < package.repo"], options); // Print HEAD commits of all repos yield execShellCommand(["vcs log -l1 src/"], options); - // rosdep does not really work on Windows, so do not use it - // See: https://github.com/ros-infrastructure/rosdep/issues/610 - if (!isWindows && !skipRosdepInstall) { + if (isLinux && !skipRosdepInstall) { // Always update package index before installing packages const dist = yield determineDistrib(); if (dist === "ubuntu") { @@ -31189,6 +31187,10 @@ done`; else { core.setFailed(`Unsupported distribution ${dist}`); } + } + // rosdep does not really work on Windows, so do not use it + // See: https://github.com/ros-infrastructure/rosdep/issues/610 + if (!isWindows && !skipRosdepInstall) { yield installRosdeps(buildPackageSelection, rosdepSkipKeysSelection, rosWorkspaceDir, options, targetRos1Distro, targetRos2Distro); } if (skipRosdepInstall && rosdepCheck) { diff --git a/src/action-ros-ci.ts b/src/action-ros-ci.ts index bf9682ee..19c7bd8a 100644 --- a/src/action-ros-ci.ts +++ b/src/action-ros-ci.ts @@ -650,9 +650,7 @@ done`; // Print HEAD commits of all repos await execShellCommand(["vcs log -l1 src/"], options); - // rosdep does not really work on Windows, so do not use it - // See: https://github.com/ros-infrastructure/rosdep/issues/610 - if (!isWindows && !skipRosdepInstall) { + if (isLinux && !skipRosdepInstall) { // Always update package index before installing packages const dist: string = await determineDistrib(); if (dist === "ubuntu") { @@ -664,7 +662,10 @@ done`; } else { core.setFailed(`Unsupported distribution ${dist}`); } - + } + // rosdep does not really work on Windows, so do not use it + // See: https://github.com/ros-infrastructure/rosdep/issues/610 + if (!isWindows && !skipRosdepInstall) { await installRosdeps( buildPackageSelection, rosdepSkipKeysSelection,