-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Init ava unit testing * 👷 Run unit tests in CI * Add CI status badge to README * Add c8 code coverage * Fix prebuilding of test files * Fix c8 coverage and cleanup config * 👷 Add coverage to CI
- Loading branch information
Showing
15 changed files
with
3,125 additions
and
569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"reporter": [ | ||
"json", | ||
"text-summary" | ||
], | ||
"extension": [ | ||
".ts" | ||
], | ||
"sourceMap": true, | ||
"exclude-after-remap": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Tests | ||
on: [ push ] | ||
|
||
jobs: | ||
unit: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
if: github.event.pull_request.draft == false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: npm i | ||
|
||
- name: Prebuild files | ||
run: npm run test:prebuild | ||
|
||
- name: Run ava unit tests | ||
run: npm run test:ava | ||
|
||
coverage: | ||
name: Code coverage | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
if: github.event.pull_request.draft == false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: npm i | ||
|
||
- name: Prebuild files | ||
run: npm run test:prebuild | ||
|
||
- name: Run c8 coverage | ||
run: | | ||
echo "LINE_COVERAGE=$(npm run coverage:test:ava | grep -E '^\s*Lines\s*:\s*[0-9]+(\.[0-9]+)?%' | awk '{print $3}' | tr -d '%')" >> $GITHUB_ENV | ||
- name: Update coverage badge | ||
uses: schneegans/[email protected] | ||
with: | ||
auth: ${{ secrets.GIST_SECRET }} | ||
gistID: 615b7906cd71effb447c4b08673d2cb6 | ||
filename: latch-coverage.json | ||
label: Coverage | ||
message: ${{ env.LINE_COVERAGE }} | ||
valColorRange: ${{ env.LINE_COVERAGE }} | ||
maxColorRange: 100 | ||
minColorRange: 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
</p> | ||
|
||
<a href="https://doi.org/10.1016/j.scico.2024.103157"><img src="https://img.shields.io/badge/DOI-10.1016%2Fj.scico.2024.103157-blue.svg"></a> | ||
<a href="https://github.com/TOPLLab/latch/actions/workflows/test.yml"><img src="https://github.com/TOPLLab/latch/actions/workflows/test.yml/badge.svg"></a> | ||
<a href="https://github.com/TOPLLab/latch/actions/workflows/test.yml"><img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/tolauwae/615b7906cd71effb447c4b08673d2cb6/raw/latch-coverage.json"></a> | ||
|
||
<b> | ||
<a href="https://topllab.github.io/WARDuino/guide/latch.html">Documentation</a> | ||
|
@@ -22,7 +24,7 @@ git clone [email protected]:TOPLLab/latch.git | |
cd latch | ||
npm install | ||
npm run build | ||
npm run test | ||
npm run tests | ||
``` | ||
|
||
## About | ||
|
Oops, something went wrong.