In my Angular project I want to run automated test on every push on any branches with this YAML file:
on: [push]
jobs:
ng-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm ci
run: |
cd angular/
npm ci
- name: ng test
run: |
cd angular/
npm run test:ci
And the result is this:
Chrome Headless 96.0.4664.45 (Linux x86_64): Executed 18 of 23 (skipped 5) SUCCESS (0.817 secs / 0.519 secs)
TOTAL: 36 SUCCESS
TOTAL: 36 SUCCESS
TOTAL: 36 SUCCESS
=============================== Coverage summary ===============================
Statements : 32.12% ( 387/1205 )
Branches : 11.75% ( 53/451 )
Functions : 14.2% ( 45/317 )
Lines : 29.78% ( 341/1145 )
================================================================================
=============================== Coverage summary ===============================
Statements : 32.12% ( 387/1205 )
Branches : 11.75% ( 53/451 )
Functions : 14.2% ( 45/317 )
Lines : 29.78% ( 341/1145 )
================================================================================
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myproject@11.0.0 test:ci: `ng test --watch=false --code-coverage --source-map true`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myproject@11.0.0 test:ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-12-06T12_08_18_494Z-debug.log
Error: Process completed with exit code 1.
In my local machine everything is fine.
What's wrong here? Any idea?