diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f056ff..10dd191 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,17 +12,30 @@ jobs: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] webotsVersion: [ R2023b, R2024a ] - webotsTag: [ nightly_26_7_2024, '' ] + webotsTag: [ R2024a_DeepBlueSim_2024_07_28, nightly_26_7_2024, '' ] + webotsRepository: [ DeepBlueRobotics/webots, '' ] webotsBaseUrl: [ 'https://github.com/DeepBlueRobotics/webots/releases/download/R2024a_DeepBlueSim_2024_07_28', '' ] exclude: + # R2024a has not yet been released - webotsVersion: R2024a webotsTag: '' webotsBaseUrl: '' + # cyberbots/webots#6586 - webotsVersion: R2024a webotsTag: nightly_26_7_2024 os: windows-latest + # Only use tags on their corresponding repositories + - webotsTag: R2024a_DeepBlueSim_2024_07_28 + webotsRepository: '' + - webotsTag: 'nightly_26_7_2024' + webotsRepository: DeepBlueRobotics/webots + - webotsTag: '' + webotsRepository: DeepBlueRobotics/webots + # R2023b Should only be run with default parameters - webotsVersion: R2023b webotsTag: nightly_26_7_2024 + - webotsVersion: R2023b + webotsRepository: DeepBlueRobotics/webots - webotsVersion: R2023b webotsBaseUrl: 'https://github.com/DeepBlueRobotics/webots/releases/download/R2024a_DeepBlueSim_2024_07_28' runs-on: ${{ matrix.os }} @@ -37,6 +50,7 @@ jobs: with: webotsVersion: ${{ matrix.webotsVersion }} webotsTag: ${{ matrix.webotsTag || '' }} + webotsRepository: ${{ matrix.webotsRepository || '' }} webotsBaseUrl: ${{ matrix.webotsBaseUrl || '' }} - name: Run Webots diff --git a/README.md b/README.md index 70af506..cb68d81 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,18 @@ This GitHub action can be used in a [GitHub workflow](https://docs.github.com/en/free-pro-team@latest/actions) to setup a version of [Webots](https://cyberbotics.com/) on ubuntu-latest, windows-latest, or macos-latest GitHub-hosted runner. Usage: +## Installing Webots + +### Install a Stable Webots Release ``` YAML - name: Setup Webots id: setupWebots uses: DeepBlueRobotics/setup-webots@main with: webotsVersion: R2023b # Set this to your Webots version - - - name: Run Webots - run: $RUN_WEBOTS /path/to/worlds/MyWorld.wbt - shell: bash ``` -Alternatively, the `webotsTag` option can be used to install a specific tag from the official Webots repository (such as a nightly build). - +### Install a Nightly Prerelease from the Official Webots Repository ``` YAML - name: Setup Webots id: setupWebots @@ -23,15 +21,22 @@ Alternatively, the `webotsTag` option can be used to install a specific tag from with: webotsVersion: R2024a # Set this to your Webots version webotsTag: nightly_26_7_2024 +``` - - name: Run Webots - run: $RUN_WEBOTS /path/to/worlds/MyWorld.wbt - shell: bash +### Install a Custom Release from a Webots Fork +``` YAML + - name: Setup Webots + id: setupWebots + uses: DeepBlueRobotics/setup-webots@main + with: + webotsVersion: R2024a # Set this to your Webots version + webotsTag: R2024a_DeepBlueSim_2024_07_28 + webotsRepository: DeepBlueRobotics/webots ``` -Alternatively, the `webotsBaseUrl` option can be used to install from an arbitrary location (such as -a fork of the official repo). Note that if you use the `webotsBaseUrl` option, the `webotsTag` -option will be ignored, so the URL should contain any needed tag information. +### Install a Custom Release from an Arbitrary URL +Note that if you use the `webotsBaseUrl` option, the `webotsTag` and `webotsRepository` options +will be ignored, so the URL should contain any needed tag information. ``` YAML - name: Setup Webots @@ -40,7 +45,11 @@ option will be ignored, so the URL should contain any needed tag information. with: webotsVersion: R2024a # Set this to your Webots version webotsBaseUrl: https://github.com/DeepBlueRobotics/webots/releases/download/R2024a_DeepBlueSim_2024_07_28 +``` +## Running Webots + +``` YAML - name: Run Webots run: $RUN_WEBOTS /path/to/worlds/MyWorld.wbt shell: bash diff --git a/action.yml b/action.yml index 8c5356b..8b56f17 100644 --- a/action.yml +++ b/action.yml @@ -5,11 +5,15 @@ inputs: description: "Version of Webots to install." required: true webotsTag: - description: "Optionally specify a specific tag from the Webots repository to install. (Defaults to webotsVersion)" + description: "Optionally specify a specific tag from the Webots repository to install. (Defaults to )" + required: false + default: '' + webotsRepository: + description: "Optionally specify a specific repository to download Webots from (Defaults to cyberbotics/webots)" required: false default: '' webotsBaseUrl: - description: "Optionally specify a base URL containing the distribution files (Defaults to https://github.com/cyberbotics/webots/releases/download/)" + description: "Optionally specify a base URL containing the distribution files (Defaults to https://github.com//releases/download/)" required: false default: '' @@ -40,19 +44,21 @@ runs: id: setup run: | webotsOptions="--no-rendering --stdout --stderr --minimize --batch" - if [ -n '${{ inputs.webotsTag }}' ]; then - webotsTag=${{ inputs.webotsTag }} - else - webotsTag=${{ inputs.webotsVersion }} - fi + webotsTag=${{ inputs.webotsTag || inputs.webotsVersion }} + webotsRepository=${{ inputs.webotsRepository || 'cyberbotics/webots' }} + if [ -n '${{ inputs.webotsBaseUrl }}' ]; then if [ -n '${{ inputs.webotsTag }}' ]; then echo "WARNING: Ignoring webotsTag=${{ inputs.webotsTag }} because webotsBaseUrl was specified." fi + if [ -n '${{ inputs.webotsRepository }}' ]; then + echo "WARNING: Ignoring webotsRepository=${{ inputs.webotsRepository }} because webotsBaseUrl was specified." + fi webotsBaseUrl=${{ inputs.webotsBaseUrl }} else - webotsBaseUrl="https://github.com/cyberbotics/webots/releases/download/$webotsTag" + webotsBaseUrl="https://github.com/$webotsRepository/releases/download/$webotsTag" fi + if [ '${{ runner.os }}' = 'Linux' ]; then webotsCachePath="$HOME/cache/webots" webotsHome="$HOME/webots" @@ -85,6 +91,7 @@ runs: echo "binDir=${webotsBinDir}" >> $GITHUB_OUTPUT echo "bin=${webotsBin}" >> $GITHUB_OUTPUT echo "pkgName=$pkgName" >> $GITHUB_OUTPUT + echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT echo "baseUrl=$webotsBaseUrl" >> $GITHUB_OUTPUT echo "RUN_WEBOTS=$webotsBashCmd" >> $GITHUB_ENV echo "LIBGL_ALWAYS_SOFTWARE=true" >> $GITHUB_ENV