chore: split GitHub Actions workflows into jobs; run tests on multiple Node.js versions #577
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: 2 | |
NODE: 20 | |
jobs: | |
size: | |
name: Check size | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE }} | |
- name: Install required packages | |
run: sudo apt install libsdl-pango-dev libgif-dev | |
- name: Install dependencies and build | |
run: yarn --frozen-lockfile | |
- name: Check size | |
run: yarn --cwd packages/renderer run size | |
test: | |
name: Run tests (Node.js ${{ matrix.node_version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node_version: [18, 20] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node_version }} | |
- name: Install required packages | |
run: sudo apt install libsdl-pango-dev libgif-dev | |
- name: Install dependencies and build | |
run: yarn --frozen-lockfile | |
- name: Run tests | |
run: yarn test |