Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Add API tests to CI and setup code coverage #39

Merged
merged 30 commits into from
Jul 3, 2020
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
40 changes: 40 additions & 0 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Code coverage

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: npm install, build, test
run: |
npm install
npm run code-coverage
mkdir coverage
npm run coveralls

- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# Path to lcov file
path-to-lcov: ./coverage/lcov.info
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ node_modules
.tests/
.lib/
lib/
.nyc_output/
coverage/
13 changes: 13 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"cache": false,
"include": [
"src/**/*.ts"
],
"require": [
"ts-node/register",
"source-map-support/register",
"tsconfig-paths/register"
]
}
2 changes: 1 addition & 1 deletion .tests/apiTestCase.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[]
{"tests":[], "map":{}}
8 changes: 4 additions & 4 deletions .tests/clusters.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{
"alias": "",
"rest_server_uri": "hostname/rest-server",
"username": "",
"password": "",
"alias": "int",
"rest_server_uri": "openpai.test/rest-server",
"username": "sdk_test",
"password": "pwd",
"token": "",
"https": true
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# OpenPAI JS SDK

[![Build Status](https://www.travis-ci.org/microsoft/openpaisdk.svg?branch=master)](https://travis-ci.org/microsoft/openpaisdk)
[![Coverage Status](https://coveralls.io/repos/github/microsoft/openpaisdk/badge.svg)](https://coveralls.io/github/microsoft/openpaisdk)

The `JavaScript` SDK is designed to facilitate the developers of [OpenPAI](https://github.com/microsoft/pai) to offer user friendly experience.

Expand Down
Loading