Skip to content

Commit

Permalink
feat: add mutation to send metrics (#115)
Browse files Browse the repository at this point in the history
* feat: add mutation to send metrics

* build: new version with mutation

* fix: dump base and head of PR

* fix: add payload

* fix: add commit and branch

* feat: send metrics to barecheck API

* fix: format coverage to float

* feat: add query to fetch metrics

* fix: linting

* fix: formatting

* fix: passing proper parasm

* fix: use await

* feat: use single workflow for code coverage

* feat: remove unused cache step

* feat: move tests to test directory

* feat: add tests to fetch metgrics

* feat: add tests for features and services dir

* feat: add test when getCoverageFromFile exception thrown

* chore: branch, commit -> ref, sha

* chore: new buidl

* feat: skip base coverage comparision if there is no base report

* chore; fix output

* fix: remove default value from base-lcov-file property

* build code
  • Loading branch information
vitaliimelnychuk authored Nov 1, 2021
1 parent 219d989 commit e0d9fa6
Show file tree
Hide file tree
Showing 32 changed files with 863 additions and 269 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node

# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: CI

on:
Expand All @@ -19,14 +15,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 14.16.1
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-v1-${{ hashFiles('yarn.lock') }}
# loading an older version is fine here, since it will get an npm install
restore-keys: |
node_modules-

- name: Install dependencies
run: yarn
Expand All @@ -39,3 +27,21 @@ jobs:

- name: Install dependencies
run: yarn test

- name: Run test coverage
run: yarn coverage

# Testing beta of code coverage checks
# This part can be removed or optimized once barecheck code coverage will be out of beta
- name: Generate Code Coverage report
id: code-coverage
uses: ./
with:
barecheck-github-app-token: ${{ secrets.BARECHECK_GITHUB_APP_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
barecheck-api-key: ${{ secrets.BARECHECK_API_KEY }}
lcov-file: "./coverage/lcov.info"
minimum-ratio: 0
send-summary-comment: true
show-annotations: "warning"
app-name: "Github Action"
63 changes: 0 additions & 63 deletions .github/workflows/main.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"javascript.validate.enable": false
"javascript.validate.enable": false,
"cSpell.words": ["Barecheck"]
}
7 changes: 5 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ inputs:
barecheck-github-app-token:
description: Barecheck application token, received after application installation
required: true
barecheck-api-key:
description: Barecheck project API key
required: false
lcov-file:
description: "Compare code coverage report"
required: true
default: "./coverage/lcov.info"
base-lcov-file:
description: "Base code coverage report to generate percentage diff"
required: true
default: "./coverage/lcov.info"
required: false
default: ""
minimum-ratio:
description: "Minimum code coverage ratio that would to be considered as a difference between based and head commits"
required: false
Expand Down
Loading

0 comments on commit e0d9fa6

Please sign in to comment.