Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .c8rc
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
}
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
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

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,17 @@ lib/*.js
test/*.js
*.map

# Project specific
WABT
core/

dist/

# IDE folders
.idea

# built ava test files
out

# c8 Coverage
coverage
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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
Expand Down
Loading
Loading