name: CodeMirror Lang KCL

on:
  pull_request:
  push:
    branches:
      - main

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  npm-unit-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version-file: '.nvmrc'
          cache: 'npm'

      - run: npm install

      - run: npm run tsc --workspace=packages/codemirror-lang-kcl

      - name: run unit tests
        run: npm run test --workspace=packages/codemirror-lang-kcl
