15 - Working with Matrices #7
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: 15 - Working with Matrices | |
on: | |
workflow_dispatch: | |
jobs: | |
backwards-compatibility: | |
name: ${{ matrix.os }}-${{ matrix.node-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
node-version: [18.x, 20.x, 21.x] | |
os: | |
- ubuntu-latest | |
- windows-latest | |
include: | |
- os: ubuntu-latest | |
node-version: 16.x | |
- os: ubuntu-latest | |
node-version: 21.x | |
tag: experimental | |
steps: | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Fail if experimental | |
if: matrix.tag == 'experimental' | |
run: exit 1 | |
- name: Perform some tests | |
run: | | |
echo "Running tests on OS ${{ matrix.os }} and NodeJS ${{ matrix.node-version }}" | |
sleep 10 | |
- name: Upload test results | |
run: echo "Uploading test results" | |
include-example: | |
name: ${{ matrix.color }}-${{ matrix.shape }}-${{ matrix.size }}-${{ matrix.opacity }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
color: [red, green] | |
shape: [circle, square] | |
size: [small, large] | |
include: | |
- opacity: 50 | |
- color: red | |
shape: triangle | |
steps: | |
- name: Dummy step | |
run: echo "${{ matrix.color }}-${{ matrix.shape }}-${{ matrix.size }}-${{ matrix.opacity }}" |