feat: added unit test cases check in workflow #6
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: Unit Test & Reports | |
| 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' | |
| - 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: | |
| - contentstack-audit | |
| - contentstack-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' | |
| - name: Check contents of plugin directory | |
| run: | | |
| cd packages/${{ matrix.plugin }} | |
| ls -la | |
| - name: Install dependencies for the plugin | |
| run: | | |
| cd packages/${{ matrix.plugin }} | |
| ls -la | |
| - name: Run tests for the plugin | |
| run: | | |
| cd packages/${{ matrix.plugin }} | |
| npm run test:unit |