Node.js 12 Tests #102
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
| # ======================================================================= | |
| # Node.js 12 Compatibility Tests Workflow | |
| # ======================================================================= | |
| # | |
| # This workflow specifically tests the compatibility of console-table-printer | |
| # and simple-wcswidth packages with Node.js 12.x. | |
| # | |
| # Since Jest 30.x is not compatible with Node.js 12.x, this workflow: | |
| # 1. Removes Jest 30.x | |
| # 2. Installs Jest 27.x which is compatible with Node.js 12 | |
| # 3. Runs the unit tests | |
| # | |
| # This ensures that users on Node.js 12.x can still use these libraries | |
| # even though the latest testing tools may not support this version. | |
| # | |
| # The workflow runs: | |
| # - Daily at 00:00 UTC | |
| # - On push to main branch | |
| # - Manually via workflow_dispatch | |
| # | |
| # ======================================================================= | |
| name: Node.js 12 Tests | |
| on: | |
| schedule: | |
| # Run once a day at midnight UTC | |
| - cron: '0 0 * * *' | |
| # Also run on push to main branch | |
| push: | |
| branches: [ main ] | |
| # Allow manual triggering | |
| workflow_dispatch: | |
| jobs: | |
| node12-tests: | |
| name: Node.js 12.x Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js 12.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '12.x' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: | | |
| # Install specific Jest/TS version that's compatible with Node.js 12 | |
| yarn add jest@27.5.1 ts-jest@27.1.5 @types/jest@27.5.2 typescript@4.5.5 --dev | |
| # Install without considering yarn.lock to ensure our custom Jest version is actually used | |
| yarn install --no-lockfile | |
| - name: Run unit tests | |
| run: yarn test |