Test platform-specific steps #1
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: Platform-specific steps | |
on: | |
push: | |
branches: [ "platform-specific-step" ] | |
pull_request: | |
branches: [ "platform-specific-step" ] | |
jobs: | |
build: | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Set up on Windows | |
if: runner.os == 'Windows' | |
shell: bash | |
run: echo "🪟" | |
- name: Set up on Linux | |
if: runner.os == 'Linux' | |
run: echo "🐧" | |
- name: Set up on macOS | |
if: runner.os == 'macOS' | |
run: echo "🍎" | |
- name: Foo | |
shell: bash | |
run: | | |
case $RUNNER_OS in | |
Windows) | |
echo "W" | |
;; | |
Linux) | |
echo "L" | |
;; | |
macOS) | |
echo "M" | |
;; | |
esac | |
- name: Bar | |
shell: bash | |
run: | | |
map_Windows="W" ; map_Linux="L" ; map_macOS="M" | |
c="$(eval echo '$'map_$RUNNER_OS)" | |
echo $c |