name: Continuous Integration / Deployment

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

jobs:
  testing:
    name: ESLint and TypeScript compilation
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Project
        uses: actions/checkout@v6

      - name: Add problem matcher
        run: echo "::add-matcher::.github/problemMatchers/eslint.json" && echo "::add-matcher::.github/problemMatchers/tsc.json"

      - name: Use Node.js
        uses: actions/setup-node@v6
        with:
          cache: 'yarn'
          node-version-file: package.json

      - name: Install Dependencies
        run: yarn

      - name: Check lint on discord-api-types
        run: yarn test:lint

      - name: Run TSC
        run: yarn build:ci

      - name: Run Type Tests
        run: yarn test:types
