Skip to content

Commit 7b79a90

Browse files
Merge staging into master
2 parents 11db032 + 2ae6758 commit 7b79a90

File tree

7 files changed

+2211
-24
lines changed

7 files changed

+2211
-24
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
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

1519
jobs:
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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
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

ember-cli-build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

mirage/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export default function () {
2+
this.passthrough('/write-coverage');
3+
24
this.namespace = '/api/v1';
35

46
this.post(

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
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",

tests/test-helper.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@ import * as QUnit from 'qunit';
44
import { setApplication } from '@ember/test-helpers';
55
import { setup } from 'qunit-dom';
66
import { start } from 'ember-qunit';
7+
import {
8+
forceModulesToBeLoaded,
9+
sendCoverage,
10+
} from 'ember-cli-code-coverage/test-support';
711

812
setApplication(Application.create(config.APP));
913

1014
setup(QUnit.assert);
1115

16+
QUnit.done(async function () {
17+
forceModulesToBeLoaded();
18+
await sendCoverage();
19+
});
20+
1221
start();

0 commit comments

Comments
 (0)