name: Check for cycles in modules

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  cyclesCheck:
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v4

      # Set up Node
      - name: Use Node.js 18
        uses: actions/setup-node@v4
        with:
          node-version: 18

      # Run install dependencies
      - name: Install dependencies
        run: npm ci

      - name: Check cycles
        run : npm run check-cycles