File tree Expand file tree Collapse file tree 7 files changed +2211
-24
lines changed Expand file tree Collapse file tree 7 files changed +2211
-24
lines changed Original file line number Diff line number Diff line change 1111 description : The commit SHA to run the workflow on
1212 required : false
1313 type : string
14+ secrets :
15+ codecov_token :
16+ description : Codecov token
17+ required : true
1418
1519jobs :
1620 build :
@@ -70,11 +74,32 @@ jobs:
7074 runs-on : ubuntu-latest
7175 needs : build
7276 steps :
77+ - name : Checkout code
78+ uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
79+ with :
80+ ref : ${{ inputs.sha }}
81+
7382 - name : Load test image
7483 uses : guidojw/actions/load-docker-image@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
7584 with :
7685 name : app
7786
7887 - name : Test
7988 run : |
80- docker run -e CI=true -t app yarn test:ember
89+ mkdir coverage
90+ docker run -e CI=true -e COVERAGE=true -v "$(pwd)"'/coverage:/opt/app/coverage' app yarn test:ember
91+
92+ - name : Upload coverage report to Codecov
93+ if : ${{ !cancelled() }}
94+ uses : codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
95+ with :
96+ fail_ci_if_error : true
97+ token : ${{ secrets.CODECOV_TOKEN }}
98+
99+ - name : Upload coverage report artifact
100+ if : ${{ !cancelled() }}
101+ uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
102+ with :
103+ name : coverage
104+ path : coverage/
105+ if-no-files-found : error
Original file line number Diff line number Diff line change 22
33[ ![ Continuous Integration] ( https://github.com/csvalpha/amber-ui/actions/workflows/continuous-integration.yml/badge.svg )] ( https://github.com/csvalpha/amber-ui/actions/workflows/continuous-integration.yml )
44[ ![ Continuous Delivery] ( https://github.com/csvalpha/amber-ui/actions/workflows/continuous-delivery.yml/badge.svg )] ( https://github.com/csvalpha/amber-ui/actions/workflows/continuous-delivery.yml )
5+ [ ![ codecov] ( https://codecov.io/gh/csvalpha/amber-ui/graph/badge.svg?token=GMTXV28YQF )] ( https://codecov.io/gh/csvalpha/amber-ui )
56
67## Prerequisites
78
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ module.exports = function (defaults) {
2323 } ,
2424
2525 babel : {
26+ plugins : [ ...require ( 'ember-cli-code-coverage' ) . buildBabelPlugin ( ) ] ,
2627 sourceMaps : 'inline' ,
2728 } ,
2829
Original file line number Diff line number Diff line change 11export default function ( ) {
2+ this . passthrough ( '/write-coverage' ) ;
3+
24 this . namespace = '/api/v1' ;
35
46 this . post (
Original file line number Diff line number Diff line change 4646 "ember-can" : " ^4.2.0" ,
4747 "ember-cli" : " ~4.11.0" ,
4848 "ember-cli-babel" : " ^7.26.10" ,
49+ "ember-cli-code-coverage" : " ^2.0.0" ,
4950 "ember-cli-content-security-policy" : " ^2.0.3" ,
5051 "ember-cli-dependency-checker" : " ^3.2.0" ,
5152 "ember-cli-dropzonejs" : " ^1.3.6" ,
Original file line number Diff line number Diff line change @@ -4,9 +4,18 @@ import * as QUnit from 'qunit';
44import { setApplication } from '@ember/test-helpers' ;
55import { setup } from 'qunit-dom' ;
66import { start } from 'ember-qunit' ;
7+ import {
8+ forceModulesToBeLoaded ,
9+ sendCoverage ,
10+ } from 'ember-cli-code-coverage/test-support' ;
711
812setApplication ( Application . create ( config . APP ) ) ;
913
1014setup ( QUnit . assert ) ;
1115
16+ QUnit . done ( async function ( ) {
17+ forceModulesToBeLoaded ( ) ;
18+ await sendCoverage ( ) ;
19+ } ) ;
20+
1221start ( ) ;
You can’t perform that action at this time.
0 commit comments