name: Test
on:
  push:
    paths:
      - .gitea/workflows/test.yaml
      - src/**/*
      - test/**/*
      - .mocharc.js
      - tsconfig.json
      - package.json
      - .yarnrc.yml
      - yarn.lock

jobs:
  test:
    runs-on: ubuntu-latest
    container:
      image: node:lts
      env:
        JIG_SOFTWARE_GITEA_DEPLOYMENT_TOKEN: ${{ secrets._CI_REGISTRY_ACCESS_TOKEN }}
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Install packages
        run: corepack enable && yarn
      - name: Test code
        run: yarn test:coverage
