Skip to content

Commit

Permalink
Added code coverage.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Jun 6, 2024
1 parent 3ad078c commit 47dd903
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Tools
name: Test Tools (Integration)

on:
push:
Expand All @@ -9,6 +9,7 @@ on:
- 'jest.config.js'
- 'tsconfig.json'
- 'tools/**'
- '.github/workflows/test-tools*.yml'
pull_request:
branches: ['**']
paths:
Expand All @@ -17,6 +18,7 @@ on:
- 'jest.config.js'
- 'tsconfig.json'
- 'tools/**'
- '.github/workflows/test-tools*.yml'

jobs:
test:
Expand All @@ -43,8 +45,9 @@ jobs:
- name: Install Dependencies
run: npm install

- name: Lint
run: npm run lint

- name: Tests
run: npm run test
run: |
npm run test:integ -- --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
46 changes: 46 additions & 0 deletions .github/workflows/test-tools-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test Tools (Unit)

on:
push:
branches: ['**']
paths:
- 'package*.json'
- 'eslint.config.mjs'
- 'jest.config.js'
- 'tsconfig.json'
- 'tools/**'
- '.github/workflows/test-tools*.yml'
pull_request:
branches: ['**']
paths:
- 'package*.json'
- 'eslint.config.mjs'
- 'jest.config.js'
- 'tsconfig.json'
- 'tools/**'
- '.github/workflows/test-tools*.yml'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install Dependencies
run: npm install

- name: Lint
run: npm run lint

- name: Tests
run: |
npm run test:unit -- --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ node_modules
_site/

# build output
build/
build/

# coverage output
coverage/

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added license headers to TypeScript code ([#311](https://github.com/opensearch-project/opensearch-api-specification/pull/311))
- Added `npm run test:spec -- --dry-run --verbose` ([#303](https://github.com/opensearch-project/opensearch-api-specification/pull/303))
- Added `npm run test:unit` and `test:integ` ([#320](https://github.com/opensearch-project/opensearch-api-specification/pull/320))
- Added code coverage ([#323](https://github.com/opensearch-project/opensearch-api-specification/pull/323))

### Changed

Expand Down

0 comments on commit 47dd903

Please sign in to comment.