test update

This commit is contained in:
Anthony Stirling 2025-08-26 13:16:19 +01:00
parent e724416f23
commit 05484b5e4c
3 changed files with 22 additions and 14 deletions

View File

@ -143,21 +143,20 @@ jobs:
uses: actions/setup-node@v4.1.0
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Configure npm with token (if available)
if: secrets.NPM_TOKEN != ''
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install frontend dependencies
run: cd frontend && npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Build frontend
run: cd frontend && npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Run frontend tests
run: cd frontend && npm run test -- --run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Clean up npmrc
if: always() && secrets.NPM_TOKEN != ''
run: rm -f ~/.npmrc
- name: Upload frontend build artifacts
uses: actions/upload-artifact@v4.6.2
with:

View File

@ -48,21 +48,24 @@ jobs:
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Configure npm with token (if available)
if: secrets.NPM_TOKEN != ''
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Generate frontend license report
working-directory: frontend
run: npm run generate-licenses
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Clean up npmrc
if: always() && secrets.NPM_TOKEN != ''
run: rm -f ~/.npmrc
- name: Check for license warnings
run: |

View File

@ -131,8 +131,11 @@ jobs:
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Configure npm with token (if available)
if: secrets.NPM_TOKEN != ''
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Run TestDriver.ai
uses: testdriverai/action@f0d0f45fdd684db628baa843fe9313f3ca3a8aa8 #1.1.3
@ -148,8 +151,11 @@ jobs:
1. /run testing/testdriver/test.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
FORCE_COLOR: "3"
- name: Clean up npmrc
if: always() && secrets.NPM_TOKEN != ''
run: rm -f ~/.npmrc
cleanup:
needs: [deploy, test]