name: CI

on:
  push:
    branches:
      - '**'
    tags-ignore:
      - '**'
  pull_request:
    branches:
      - '**'

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest]
        node-version: [20.x, 22.x]
    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: install pnpm
        run: npm install -g pnpm
      - run: pnpm install --frozen-lockfile
      - run: pnpm build
      - run: pnpm test
        if: matrix.os == 'ubuntu-latest'
      - run: pnpm lint
