Simplify Workflow When Using a Custom GitHub Repository #116
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
webotsVersion: [ R2023b, R2024a ] | |
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 }} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Setup Webots | |
id: setupWebots | |
uses: ./ | |
with: | |
webotsVersion: ${{ matrix.webotsVersion }} | |
webotsTag: ${{ matrix.webotsTag || '' }} | |
webotsRepository: ${{ matrix.webotsRepository || '' }} | |
webotsBaseUrl: ${{ matrix.webotsBaseUrl || '' }} | |
- name: Run Webots | |
run: $RUN_WEBOTS --sysinfo | |
shell: bash | |
- name: Display outputs | |
run: | | |
echo "RUN_WEBOTS: $RUN_WEBOTS" | |
echo "steps.setupWebots.outputs.bashCmd: ${{ steps.setupWebots.outputs.bashCmd }}" | |
echo "steps.setupWebots.outputs.home: ${{ steps.setupWebots.outputs.home }}" | |
echo "steps.setupWebots.outputs.binDir: ${{ steps.setupWebots.outputs.binDir }}" | |
echo "steps.setupWebots.outputs.bin: ${{ steps.setupWebots.outputs.bin }}" | |
echo "steps.setupWebots.outputs.cachePath: ${{ steps.setupWebots.outputs.cachePath }}" | |
shell: bash | |
release: | |
# Only release from the main branch | |
if: github.ref == 'refs/heads/main' | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Compute next semantic version | |
id: version | |
uses: paulhatch/[email protected] | |
with: | |
branch: "main" | |
- name: Tag | |
run: git tag ${{ steps.version.outputs.version_tag }} | |
- name: Push | |
run: git push origin ${{ steps.version.outputs.version_tag }} |