Skip to content

Commit

Permalink
Update c-cpp.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxy-v authored Aug 31, 2024
1 parent fc45bd9 commit a04f7b5
Showing 1 changed file with 48 additions and 13 deletions.
61 changes: 48 additions & 13 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,52 @@ jobs:
uses: actions/github-script@v7
with:
script: |
var fs = require('fs');
var parseString = require('xml2js').parseString;
function requestReport(callback) {
fs.readFile('coverage.xml', 'utf8', function(err, data) {
if (err) return callback(err);
parseString(data, callback);
});
}
requestReport(function(err, result) {
if (err) return console.error(err);
console.log(JSON.stringify(result));
const fs = require('fs');
const parseString = require('xml2js').parseString;
const result = await new Promise((resolve, reject) => parseString(fs.readFileSync('coverage.xml', 'utf8'), (err, result) => {
if (err) reject(err);
else resolve(result);
});
console.log('${{ github.base_ref || github.ref_name }}');
# "packages": [
# {
# "package": [
# {
# "$": {
# "name": "src",
# "line-rate": "0.5",
# "branch-rate": "0.5",
# "complexity": "0.0"
# },
# "classes": [
# {
# "class": [
# {
# "$": {
# "name": "main_cpp",
# "filename": "src/main.cpp",
# "line-rate": "0.0",
# "branch-rate": "1.0",
# "complexity": "0.0"
# },
# "methods": [
# ""
# ],
# "lines": [
# {
# "line": [
# {
# "$": {
# "number": "6",
# "hits": "0",
# "branch": "false"
# }
# },
# {
# "$": {
# "number": "7",
# "hits": "0",
# "branch": "false"
# }
# },

0 comments on commit a04f7b5

Please sign in to comment.