-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding action support for windows (#28)
* Added action test for setup-conda --------- Signed-off-by: Saurabh Kamat <[email protected]>
- Loading branch information
Showing
7 changed files
with
275 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,3 +148,22 @@ jobs: | |
required-gazebo-distributions: 'harmonic' | ||
- name: 'Test Gazebo installation' | ||
run: 'gz sim --versions' | ||
|
||
test_gazebo_install_windows: | ||
name: 'Check installation of Gazebo on Windows' | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: '20.x' | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
- name: 'Check Gazebo installation on Windows runner' | ||
uses: ./ | ||
with: | ||
required-gazebo-distributions: 'harmonic' | ||
- name: 'Test Gazebo installation' | ||
shell: pwsh | ||
run: | | ||
conda activate | ||
gz sim --versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,10 @@ This action sets up a Gazebo release inside a Linux environment. | |
1. [Setting up worker and installing a compatible Gazebo and Ubuntu combination](#Setting-up-worker-and-installing-a-compatible-Gazebo-and-Ubuntu-combination) | ||
1. [Iterating on all Gazebo and Ubuntu combinations](#Iterating-on-all-gazebo-ubuntu-combinations) | ||
1. [Using pre-release and/or nightly Gazebo binaries](#Using-pre-release-and/or-nightly-Gazebo-binaries) | ||
2. [MacOS](#MacOS) | ||
2. [macOS](#macOS) | ||
1. [Setting up worker to install Gazebo on macOS](#Setting-up-worker-to-install-Gazebo-on-macOS) | ||
3. [Windows](#Windows) | ||
1. [Setting up worker to install Gazebo on Windows](#Setting-up-worker-to-install-Gazebo-on-Windows) | ||
1. [License](#License) | ||
|
||
## Overview | ||
|
@@ -25,6 +27,7 @@ It is recommended to use the `setup-gazebo` action inside a Docker container due | |
`setup-gazebo` action works for all non-EOL Gazebo [releases] on the following platforms: | ||
- Ubuntu | ||
- macOS | ||
- Windows | ||
|
||
## Tasks performed by the action | ||
|
||
|
@@ -36,6 +39,8 @@ The `setup-gazebo` action performs the following tasks: | |
- Registers the Open Robotics APT repository | ||
- On macOS: | ||
- Tapping into the [osrf/homebrew-simulation](https://github.com/osrf/homebrew-simulation) using Homebrew | ||
- On Windows: | ||
- Installing Gazebo using Conda from conda-forge | ||
## Usage | ||
|
||
See [action.yml](action.yml) | ||
|
@@ -155,7 +160,7 @@ This workflow shows how to use binaries from [pre-release] or [nightly] Gazebo r | |
run: 'gz sim --versions' | ||
``` | ||
|
||
### MacOS | ||
### macOS | ||
|
||
#### Setting up worker to install Gazebo on macOS | ||
|
||
|
@@ -177,6 +182,32 @@ This workflow shows how to install Gazebo on a macOS worker. The action needs an | |
run: 'gz sim --versions' | ||
``` | ||
|
||
### Windows | ||
|
||
This workflow shows how to install Gazebo on a Windows worker. The action requires a Conda package management system such as miniconda as all Gazebo packages are available on conda-forge. The action is run by specifying the distribution of choice in `required-gazebo-distributions` field. | ||
|
||
#### Setting up worker to install Gazebo on Windows | ||
|
||
```yaml | ||
test_gazebo: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: '20.x' | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
- name: 'Check Gazebo installation on Windows runner' | ||
uses: gazebo-tooling/setup-gazebo@<full_commit_hash> | ||
with: | ||
required-gazebo-distributions: 'harmonic' | ||
- name: 'Test Gazebo installation' | ||
shell: pwsh | ||
run: | | ||
conda activate | ||
gz sim --versions | ||
``` | ||
|
||
## License | ||
|
||
The scripts and documentation in this project are released under the [Apache 2](LICENSE) license. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as utils from "../utils"; | ||
|
||
/** | ||
* Run conda install on a list of specified packages. | ||
* | ||
* @param packages list of conda-forge packages to be installed | ||
* @returns Promise<number> exit code | ||
*/ | ||
export async function runConda(packages: string[]): Promise<number> { | ||
return utils.exec( | ||
"conda", | ||
["install", "--channel", "conda-forge"].concat(packages), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import * as utils from "./utils"; | ||
import * as conda from "./package_manager/conda"; | ||
|
||
// List of mapped Gazebo distro to gz-sim versions | ||
const validLibVersions: { distro: string; libVersion: number }[] = [ | ||
{ | ||
distro: "garden", | ||
libVersion: 7, | ||
}, | ||
{ | ||
distro: "harmonic", | ||
libVersion: 8, | ||
}, | ||
]; | ||
|
||
/** | ||
* Get gz-sim library version corresponding to a gz-$collection | ||
* since conda does not currently support the gz-$collection metapackages. | ||
* See https://github.com/conda-forge/gz-sim-feedstock/issues/61 | ||
* | ||
* @param gazeboDistro name of Gazebo distribution | ||
* @returns gz-sim version | ||
*/ | ||
async function getLibVersion(gazeboDistro: string): Promise<number> { | ||
let version: number | undefined; | ||
validLibVersions.forEach((obj) => { | ||
if (obj.distro == gazeboDistro) { | ||
version = obj.libVersion; | ||
} | ||
}); | ||
if (version === undefined) { | ||
throw new Error(`No conda packages available for gz-${gazeboDistro}`); | ||
} | ||
return version; | ||
} | ||
|
||
/** | ||
* Install Gazebo on a Windows worker | ||
*/ | ||
export async function runWindows(): Promise<void> { | ||
for (const gazeboDistro of utils.getRequiredGazeboDistributions()) { | ||
const version = await getLibVersion(gazeboDistro); | ||
await conda.runConda([`gz-sim${version}`]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters