Skip to content

GHA Matrix Examples #15

GHA Matrix Examples

GHA Matrix Examples #15

Workflow file for this run

name: GHA Matrix Examples
on:
workflow_dispatch:
jobs:
fail-fast-true-continue-on-error-true:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: true
matrix:
type_a: [type_a_00, type_a_01, type_a_02]
steps:
-
name: Step One
run: |
if [[ "${{ matrix.type_a }}" == "type_a_01" ]]; then
echo "FAIL Step One: key:${{ matrix.type_a }}" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "Step One: key:${{ matrix.type_a }}" >> $GITHUB_STEP_SUMMARY
fi
-
name: Step Two
run: |
sleep 60
echo "Step Two: key:${{ matrix.type_a }}" >> $GITHUB_STEP_SUMMARY
fail-fast-true-continue-on-error-true-always:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: true
matrix:
type_aa: [type_aa_00, type_aa_01, type_aa_02]
steps:
-
name: Step One
run: |
if [[ "${{ matrix.type_aa }}" == "type_aa_01" ]]; then
echo "FAIL Step One: key:${{ matrix.type_aa }}" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "Step One: key:${{ matrix.type_aa }}" >> $GITHUB_STEP_SUMMARY
fi
-
name: Step Two
if: ${{ always() }}
run: |
sleep 60
echo "Step Two: key:${{ matrix.type_aa }}" >> $GITHUB_STEP_SUMMARY
fail-fast-true-continue-on-error-false:
runs-on: ubuntu-latest
continue-on-error: false
strategy:
fail-fast: true
matrix:
type_b: [type_b_00, type_b_01, type_b_02]
steps:
-
name: Step One
run: |
if [[ "${{ matrix.type_b }}" == "type_b_01" ]]; then
echo "FAIL Step One: key:${{ matrix.type_b }}" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "Step One: key:${{ matrix.type_b }}" >> $GITHUB_STEP_SUMMARY
fi
-
name: Step Two
run: |
sleep 60
echo "Step Two: key:${{ matrix.type_b }}" >> $GITHUB_STEP_SUMMARY
fail-fast-false-continue-on-error-true:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
type_c: [type_c_00, type_c_01, type_c_02]
steps:
-
name: Step One
run: |
if [[ "${{ matrix.type_c }}" == "type_c_01" ]]; then
echo "FAIL Step One: key:${{ matrix.type_c }}" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "Step One: key:${{ matrix.type_c }}" >> $GITHUB_STEP_SUMMARY
fi
-
name: Step Two
run: |
sleep 60
echo "Step Two: key:${{ matrix.type_c }}" >> $GITHUB_STEP_SUMMARY
fail-fast-false-continue-on-error-false:
runs-on: ubuntu-latest
continue-on-error: false
strategy:
fail-fast: false
matrix:
type_d: [type_d_00, type_d_01, type_d_02]
steps:
-
name: Step One
run: |
if [[ "${{ matrix.type_d }}" == "type_d_01" ]]; then
echo "FAIL Step One: key:${{ matrix.type_d }}" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "Step One: key:${{ matrix.type_d }}" >> $GITHUB_STEP_SUMMARY
fi
-
name: Step Two
run: |
sleep 60
echo "Step Two: key:${{ matrix.type_d }}" >> $GITHUB_STEP_SUMMARY