Skip to content

Commit

Permalink
ci: mocha ctrf reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
felixerdy committed Nov 13, 2024
1 parent c373f16 commit 9e5d9dc
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ jobs:
run: docker build -t sketches-test -f Dockerfile.test --no-cache .

- name: Run docker test container
run: docker run sketches-test
run: docker run -v ${{ github.workspace }}/ctrf:/app/ctrf sketches-test

- name: Run CTRF annotations
run: npx github-actions-ctrf ctrf/ctrf-report.json
if: always()
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules
yarn-error.log
*.bin
*.hex

ctrf
1 change: 1 addition & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ COPY yarn.lock /app
RUN yarn
COPY src /app/src
COPY test /app/test
COPY mocha-reporters.json /app

# COPY platform.txt /app/src/arduino-ide/packages/arduino/hardware/samd/1.8.11

Expand Down
3 changes: 3 additions & 0 deletions mocha-reporters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reporterEnabled": "spec, mocha-ctrf-json-reporter"
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"scripts": {
"start": "node src/index.js",
"test": "mocha --exit --timeout 60000"
"test": "mocha --exit --timeout 60000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporters.json"
},
"dependencies": {
"body-parser": "^1.18.2",
Expand All @@ -20,6 +20,8 @@
"devDependencies": {
"chai": "^4.2.0",
"chai-http": "^4.2.0",
"mocha": "^5.2.0"
"mocha": "^5.2.0",
"mocha-ctrf-json-reporter": "^0.0.6",
"mocha-multi-reporters": "^1.5.1"
}
}
27 changes: 26 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ debug@^3.1.0:
dependencies:
ms "^2.1.1"

debug@^4.1.1:
version "4.3.7"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52"
integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==
dependencies:
ms "^2.1.3"

deep-eql@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
Expand Down Expand Up @@ -398,6 +405,11 @@ isarray@~1.0.0:
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=

lodash@^4.17.15:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==

loupe@^2.3.1:
version "2.3.4"
resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.4.tgz#7e0b9bffc76f148f9be769cb1321d3dcf3cb25f3"
Expand Down Expand Up @@ -458,6 +470,19 @@ mkdirp@0.5.1:
dependencies:
minimist "0.0.8"

mocha-ctrf-json-reporter@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/mocha-ctrf-json-reporter/-/mocha-ctrf-json-reporter-0.0.6.tgz#b27dfd01570a28f90f41d2cc12f8228142e6ec85"
integrity sha512-a5wBPTIYDfbSHKKYH6iM6Ut1PT2gpOoGe4tXB3SFYSou5QGUEcWHKBcHpnWGxVRUcYDMtNPU6n1127OHgS3qCA==

mocha-multi-reporters@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/mocha-multi-reporters/-/mocha-multi-reporters-1.5.1.tgz#c73486bed5519e1d59c9ce39ac7a9792600e5676"
integrity sha512-Yb4QJOaGLIcmB0VY7Wif5AjvLMUFAdV57D2TWEva1Y0kU/3LjKpeRVmlMIfuO1SVbauve459kgtIizADqxMWPg==
dependencies:
debug "^4.1.1"
lodash "^4.17.15"

mocha@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6"
Expand Down Expand Up @@ -491,7 +516,7 @@ ms@2.0.0:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=

ms@^2.1.1:
ms@^2.1.1, ms@^2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
Expand Down

0 comments on commit 9e5d9dc

Please sign in to comment.