Skip to content

Commit

Permalink
Create envtest.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mcascone authored Aug 8, 2024
1 parent 87e633e commit edbe167
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/envtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Hi Mascot

on: push

# global env var
env:
mascot: Mona

defaults:
run:
shell: bash

jobs:
windows_job:
name: Windows Job
runs-on: ubuntu-latest
steps:
- name: uses wf env
run: echo 'Hi ${{ env.mascot }}' # Hi Mona

- name: uses step env
run: echo 'Hi ${{ env.mascot }}' # Hi Octocat
env:
mascot: Octocat

linux_job:
name: Linux Job
needs: windows_job
runs-on: ubuntu-latest
env:
mascot: Tux
outputs:
mascot: ${{ steps.outstep.outputs.mascot }}
steps:
- name: uses job env
run: echo 'Hi ${{ env.mascot }}' # Hi Tux

- name: set gritty env var
run: echo "mascot=Gritty" >> $GITHUB_ENV

- name: uses changed job env
run: echo 'Hi ${{ env.mascot }}' # Hi Gritty

- name: uses step env
run: echo "Hi ${{ env.mascot }}" # Hi Mika
env:
mascot: Mika

- name: uses job env again
run: echo 'Hi ${{ env.mascot }}' # Hi Gritty

- name: set output using job env
id: outstep
run: echo "mascot=${{ env.mascot }}" >> $GITHUB_OUTPUT # Gritty

macos_job:
name: macOS Job
needs: linux_job
runs-on: ubuntu-latest
steps:
- name: uses wf env
run: echo 'Hi ${{ env.mascot }}' # Hi Mona

- name: uses prior job output
run: echo 'Hi ${{ needs.linux_job.outputs.mascot }}' # Hi Gritty

0 comments on commit edbe167

Please sign in to comment.