feat: added unit test cases check in workflow #18
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Unit Tests | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| # Install dependencies once globally | |
| install-dependencies: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - name: Install dependencies for all plugins | |
| run: | | |
| npm run setup-repo-old | |
| # Test plugins dynamically | |
| test-plugins: | |
| runs-on: ubuntu-latest | |
| needs: install-dependencies # Ensures this job runs after dependencies are installed | |
| strategy: | |
| matrix: | |
| plugin: | |
| - cli-audit | |
| - cli-cm-export-to-csv | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - name: Check current directory | |
| run: pwd | |
| - name: List files in plugin directory | |
| run: ls -R /home/runner/work/cli/cli | |
| - name: Run tests for the plugin | |
| working-directory: /home/runner/work/cli/cli/packages/${{ matrix.plugin }} | |
| run: npm run test:unit |