매트릭스?
- 행렬이라는 뜻
버전, os가 너무 많은데 여러 타겟으로 동시 빌드하는 것을(모든 경우의 수를 커버하는 것을) 매트릭스 빌드라고 하는 것.
name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
위의 코드는 사진에서 Node.js의 Configure을 클릭해 기본 템플릿을 이용해 만든 코드이다.
matrix:
node-version: [14.x, 16.x, 18.x]
이와같이 매트릭스 부분이 있는데 이는 노드의 14, 16, 18버전에서 실행해보겠다는 뜻.
작성해준 명령어를 차례로 실행하며 결과를 보여주는 모습.