-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 1.85 KB
/
node16-tests.yml
File metadata and controls
68 lines (60 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# =======================================================================
# Node.js 16 Compatibility Tests Workflow
# =======================================================================
#
# This workflow specifically tests the compatibility of console-table-printer
# and simple-wcswidth packages with Node.js 16.x.
#
# Since Jest 30.x is not compatible with Node.js 16.x, this workflow:
# 1. Removes Jest 30.x
# 2. Installs Jest 29.x which is compatible with Node.js 16
# 3. Runs the unit tests
#
# This ensures that users on Node.js 16.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
#
# Test results are uploaded as artifacts and stored for 7 days.
# =======================================================================
name: Node.js 16 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:
node16-tests:
name: Node.js 16.x Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: '16.x'
cache: 'yarn'
- name: Install dependencies
run: |
# Remove incompatible Jest 30.x
yarn remove jest
# Install Jest 29.x which is compatible with Node.js 16
yarn add jest@29 --dev
- name: Run unit tests
run: yarn test:unit
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: node16-test-results
path: |
junit.xml
retention-days: 7