Skip to content

Update example.yaml #268

Update example.yaml

Update example.yaml #268

Workflow file for this run

name: Example Action
on:
push:
branches: ['main']
workflow_dispatch:
jobs:
job-with-name:
name: build name
runs-on: ubuntu-latest
steps:
- run: env | grep GITHUB_
- uses: actions/checkout@v4
- uses: ./
with:
job-name: build name
- run: |
echo github.job: ${{ github.job }}
job-with-environment:
runs-on: ubuntu-latest
environment: test
steps:
- uses: actions/checkout@v4
- uses: ./
job-with-matrix:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 20.x]
steps:
- uses: actions/checkout@v4
- uses: ./
- run: |
echo github.job: ${{ github.job }}
job-with-matrix-nested-objects:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-16.04, ubuntu-latest ]
compiler: [ { cpp: g++, c: gcc }, { cpp: g++-8, c: gcc-8 } ]
steps:
- uses: actions/checkout@v4
- uses: ./
- run: |
echo github.job: ${{ github.job }}
job-with-matrix-nested-arrays:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [ [g++, gcc ], [g++-8, gcc-8 ] ]
steps:
- uses: actions/checkout@v4
- uses: ./
- run: |
echo github.job: ${{ github.job }}
job-with-reusable-workflow-with-matrix:
strategy:
matrix:
node-version: [ 22.x, 20.x ]
uses: ./.github/workflows/example-reusable.yml
with:
# IMPORTANT ensure first value match the surrounding job name
# IMPORTANT If the surrounding workflow is a reusable workflow itself, append ', ${{ inputs.workflow-context }}'
workflow-context: job-with-reusable-workflow-with-matrix, ${{ toJSON(matrix) }}
job-with-reusable-workflow-nested:
uses: ./.github/workflows/example-reusable-nested.yml
with:
# IMPORTANT ensure first value match the surrounding job name
# IMPORTANT If the surrounding workflow is a reusable workflow itself, append ', ${{ inputs.workflow-context }}'
workflow-context: job-with-reusable-workflow-nested, ${{ toJSON(matrix) }}
job-with-real-long-id-abcdefghijklmnopyrstuvwxyz-abcdefghijklmnopyrstuvwxyz-abcdefghijklmnopyrst:
strategy:
matrix:
node-version: [ 22.x, 20.x ]
uses: ./.github/workflows/example-reusable.yml
with:
# IMPORTANT ensure first value match the surrounding job name
# IMPORTANT If the surrounding workflow is a reusable workflow itself, append ', ${{ inputs.workflow-context }}'
workflow-context: job-with-real-long-id-abcdefghijklmnopyrstuvwxyz-abcdefghijklmnopyrstuvwxyz-abcdefghijklmnopyrstuv, ${{ toJSON(matrix) }}