@@ -3,95 +3,79 @@ name: Node.js CI
33on :
44  pull_request :
55    branches :
6-     - main   
6+        - main 
77
88env :
9-      MAX_HIGH : 0 
10-      MAX_CRITICAL : 0 
9+   MAX_HIGH : 0 
10+   MAX_CRITICAL : 0 
1111
1212jobs :
1313  build :
14- 
1514    runs-on : ubuntu-latest 
1615
1716    strategy :
1817      matrix :
1918        #  These versions match Upsun support
2019        #    Node.js: https://docs.upsun.com/languages/nodejs.html#supported-versions
21-         node-version : [18.x, 20.x, 21 .x] 
20+         node-version : [22 .x] 
2221        #    Python: https://docs.upsun.com/languages/python.html#supported-versions
23-         python-version : ['3.9', '3.10', '3.11', '3. 12'] 
22+         python-version : ['3.12'] 
2423
2524    steps :
2625      # ###############################################################################################
2726      #  A. Setup workflow.
28-       - name : " 1.  Retrieve local files." 
27+       - name : " Retrieve local files." 
2928        uses : actions/checkout@v4 
3029        with :
3130            ref : ${{ github.event.pull_request.head.sha }} 
32-       - name : " 2.  Set up Node.js." 
31+       - name : " Set up Node.js." 
3332        uses : actions/setup-node@v3 
3433        with :
3534          node-version : ${{ matrix.node-version }} 
36-       - name : " 3.  Python." 
35+       - name : " Python." 
3736        uses : actions/setup-python@v4  
3837        with :
3938          python-version : ${{ matrix.python-version }} 
40-           cache : ' pip' 
41- 
42-       # ###############################################################################################
43-       #  B. Prettify, lint, and test repo.
44-       - name : " 4. Preparing" 
39+           cache : ' pip' #  harmless even though we'll use uv
40+       - name : " Install uv" 
41+         uses : astral-sh/setup-uv@v6 
42+         with :
43+           version : latest  
44+       - name : " Install bun" 
45+         uses : oven-sh/setup-bun@v2 
46+         with :
47+           bun-version : latest 
48+       - name : " Install application dependencies" 
4549        run : | 
4650          echo "::notice::Running react-scripts tests." 
4751          export CI=true 
48-           npm install cross-env npm-run-all -g 
49-           npm install 
52+           bun install 
5053name : " 5. Verifying backend code is pretty" 
51-         run : |  
52-           npm run prettier:backend 
54+         run : bun run prettier:backend 
5355      - name : " 6. Verifying frontend code is pretty" 
54-         run : | 
55-           npm run prettier:frontend 
56+         run : bun run prettier:frontend 
5657      - name : " 7. Linting frontend" 
57-         run : npm  run lint:frontend
58+         run : bun  run lint:frontend
5859      - name : " 8. Run Frontend tests" 
59-         run : npm  run test:frontend
60+         run : bun  run test:frontend
6061      - name : " 9. Run Backend linting" 
61-         run : | 
62-           npm run lint:backend 
62+         run : bun run lint:backend 
6363
6464      # ###############################################################################################
6565      #  C. Ensure no vulnerabilities.
6666      - name : " 10. Test: there should be no Python vulnerabilities." 
6767        run : | 
6868          echo "::notice::Checking for vulnerabilities in backend Python app dependencies." 
69-           npm  run test:backend 
69+           bun  run test:backend 
7070name : " 11. Test: there should be no HIGH Node.js vulnerabilities." 
7171        run : | 
72-           echo "::notice::Checking for high  vulnerabilities in frontend Node.js app dependencies ." 
72+           echo "::notice::Checking HIGH  vulnerabilities (bun audit) ." 
7373          cd frontend 
7474          export CI=true 
75-           HIGH_VULN_ALLOWED=${{ env.MAX_HIGH }} 
76-           HIGH_VULN=$(npm audit --json | jq '.metadata.vulnerabilities.high') 
77-           if [ "$HIGH_VULN" -gt "$HIGH_VULN_ALLOWED" ]; then 
78-               echo "::error::NPM HIGH vulnerabilities exceed allowed budget." 
79-               npm audit 
80-               exit 1 
81-           else 
82-               echo "::notice::No HIGH vulnerabilities found on frontend app." 
83-           fi 
75+           bun audit --audit-level=high 
8476name : " 12. Test: there should be no CRITICAL Node.js vulnerabilities." 
8577        run : | 
86-           echo "::notice::Checking for critical  vulnerabilities in frontend Node.js app dependencies ." 
78+           echo "::notice::Checking CRITICAL  vulnerabilities (bun audit) ." 
8779          cd frontend 
8880          export CI=true 
89-           CRITICAL_VULN_ALLOWED=${{ env.MAX_CRITICAL }} 
90-           CRITICAL_VULN=$(npm audit --json | jq '.metadata.vulnerabilities.high') 
91-           if [ "$CRITICAL_VULN" -gt "$CRITICAL_VULN_ALLOWED" ]; then 
92-               echo "::error::NPM CRITICAL vulnerabilities exceed allowed budget." 
93-               npm audit 
94-               exit 1 
95-           else 
96-               echo "::notice::No CRITICAL vulnerabilities found on frontend app." 
97-           fi 
81+           bun audit --audit-level=critical 
0 commit comments