name: ci

on:
  push:
  release:
    types:
      - published

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version:   ['18.18.2', '20.5.1']
    steps:
      - uses: actions/checkout@v3
      - uses: volta-cli/action@v4
        with:
            node-version: '${{ matrix.node-version }}'
            yarn-version: '1.22.19'
      - uses: actions/cache@v3
        id: cache
        with:
          path: node_modules
          key: ${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
      - if: steps.cache.outputs.cache-hit != 'true'
        run: yarn install
      - run: yarn test
