Skip to content

Commit

Permalink
chore: ci adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
rgwozdz committed Feb 26, 2024
1 parent 0ff0cf9 commit 7b8be72
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 161 deletions.
146 changes: 1 addition & 145 deletions .coverage_json/coverage-summary.json

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
steps:
- name: Checkout actions
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
git checkout -b master origin/master
git checkout -

- uses: actions/setup-node@v3
with:
Expand Down
7 changes: 4 additions & 3 deletions ci/format-branch-coverage-changes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { writeFileSync, existsSync } = require('fs');
const json2md = require('json2md');
const coverageSummary = require('../.coverage_json/coverage-summary.json');

const markdownFilePath = '.branch-coverage-changes.md';

if (!existsSync('.coverage_changes_json/coverage-summary.json')) {
Expand All @@ -16,10 +17,10 @@ const rows = Object.entries(coverageChangesSummary)
return filePath !== 'total';
})
.map(([filePath, changesCoverage]) => {
const masterCoverage = coverageSummary[filePath];
const packagePath = filePath.split('packages')[1];
const packageFilePath = `packages${filePath.split('packages')[1]}`;
const masterCoverage = coverageSummary[packageFilePath];
return [
`packages${packagePath}`,
packageFilePath,
formatCovComparison(changesCoverage.statements.pct, masterCoverage.statements.pct),
formatCovComparison(changesCoverage.branches.pct, masterCoverage.branches.pct),
formatCovComparison(changesCoverage.functions.pct, masterCoverage.functions.pct),
Expand Down
12 changes: 12 additions & 0 deletions ci/format-coverage-summary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { writeFileSync } = require('fs');
const _ = require('lodash');
const coverageSummary = require('../.coverage_json/coverage-summary.json');
const formattedSummary = _.mapKeys(coverageSummary, ( value, key) => {
if(key === 'total') {
return key;
}
const packagePath = key.split('packages')[1];
return `packages${packagePath}`;
});

writeFileSync('.coverage_json/coverage-summary.json', JSON.stringify(formattedSummary), 'utf8');
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test:e2e": "cross-env SUPPRESS_NO_CONFIG_WARNING=true DATA_DIR=./test/provider-data jest",
"cov:all:html": "node ci/run-test-coverage-analysis && node ci/merge-coverage-changes && nyc report --temp-dir=.coverage/all --reporter=html --report-dir=.coverage_html",
"cov:unit:html": "node ci/run-test-coverage-analysis --context=unit && node ci/merge-coverage-changes --context=unit && nyc report --temp-dir=.coverage/all --reporter=html --report-dir=.coverage_html",
"cov:unit:json": "node ci/run-test-coverage-analysis --context=unit && node ci/merge-coverage-changes && nyc report --temp-dir=.coverage/all --reporter=json-summary --report-dir=.coverage_json",
"cov:unit:json": "node ci/run-test-coverage-analysis --context=unit && node ci/merge-coverage-changes && nyc report --temp-dir=.coverage/all --reporter=json-summary --report-dir=.coverage_json && node ci/format-coverage-summary.js",
"cov:changes:json": "npm run cov:clean && node ci/run-coverage-on-branch-changes.js && node ci/merge-coverage-changes --context=changes && node ci/run-report-on-branch-changes",
"cov:clean": "node ci/clean-coverage",
"cov:changes:2:md": "node ci/format-branch-coverage-changes.js",
Expand Down
14 changes: 7 additions & 7 deletions packages/cache-memory/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/cache-memory/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class Cache {
return;
}

helloWorld () {
return 'hello';
}

async retrieve(key, options) {
const cacheEntry = this.#cache.get(key);

Expand Down

0 comments on commit 7b8be72

Please sign in to comment.