Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add npm script and workflow for code coverage #190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
30 changes: 30 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Coverage

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: pull image
run: docker pull existdb/existdb:release
- name: create eXist-db Container
run: |
docker create --rm --name exist \
--publish 8080:8080 --publish 8443:8443 \
existdb/existdb:release
- name: Start eXist-db Container
run: docker start exist
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci --no-optional
- run: npm link
- name: Wait for container to be healthy
run: timeout 60s sh -c 'until docker ps | grep exist | grep -q healthy; do echo "Not ready yet."; sleep 2; done; echo "$(docker ps | grep exist)"'
- name: Run tests with coverage
run: npm run coverage | npx tap-dot
- name: Report coverage
run: npx c8 report -x spec --color
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ node_modules

# artifacts
*.tgz
coverage
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ nohup.out
.releaserc
.husky/*
commitlint.config.cjs
coverage
Loading