Comments (10)
@paambaati Actually I did here https://github.com/paambaati/codeclimate-action/pull/163/files#diff-04c6e90faac2675aa89e2176d2eec7d8L44
I will add few more
from codeclimate-action.
Thanks a ton @MartinNuc! This fix has now landed in v2.6.0
.
from codeclimate-action.
Finally got it working. My problem was actually with the instanbul coverage file. There were relative paths which didn't work well with monorepo like:
SF:src/server.ts
I had to set the projectRoot
in jest config. After that I had this path in lcov.info:
SF:server/src/server.ts
Which worked with formatter correctly. Here is the related issue: istanbuljs/istanbuljs#529
Solved by setting projectRoot
for lcov reporter to the actually root of the monorepo:
// server/jest.config.js
coverageReporters: [['lcov', { projectRoot: '..' }]]
After that it turned out that there is no need to use different prefix for each covarageLocation
therefore I removed that feature.
If you want you can try my version using:
- name: Coverage to Codeclimate
uses: MartinNuc/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/client/coverage/lcov.info:lcov
${{github.workspace}}/server/coverage/lcov.info:lcov
I will post the PR to this repo.
from codeclimate-action.
@awentzel Can you link me to a failing run? And also please try the latest v2.5.7
.
from codeclimate-action.
Hi @paambaati - here is a draft pr with update v2.5.7
https://github.com/microsoft/fast-dna/actions/runs/83426464 the errors include "You have an error in your yaml syntax on line 51" the problems I'm having, however, is that I can't seem to get any format to work for multiple packages so it's not clear what's expected or why it's breaking.
It's possible my syntax isn't correct. If you can share an example array that would be great. Thanks
Thanks,
Aaron
from codeclimate-action.
I have the same problem. coverageLocations
doesn't accept an array like mentioned in docs but just a string.
I believe the reason is described here: https://github.community/t5/GitHub-Actions/Can-action-inputs-be-arrays/td-p/33776
Action inputs only supports string keys and string values at this time. This is because they translate to environment variables within the action's execution run.
There are two workarounds:
- use JSON
- use string with spaces/newlines and split it into the array in the code
I will try it and make a PR 🙂
from codeclimate-action.
Thanks @MartinNuc, appreciate your help. I was going to submit some doc updates as well as soon as I got it figured out. Were you able to get it to actually format_coverage, sum_coverage, and upload_coverage? If that works it's a step in the right direction for sure. The script methods I used on Circle CI seem to be broken on GH Actions now with the cc-test-reporter. In fact, cc-test-reporter itself doesn't seem to handle mono-repos well. Thanks again.
from codeclimate-action.
Not yet. Still working on it. I had to convert also prefix into array. So files are being passed now as a multiline string (last segment after :
):
with:
coverageLocations: |
${{github.workspace}}/client/coverage/lcov.info:lcov:${{github.workspace}}/client
${{github.workspace}}/server/coverage/lcov.info:lcov:${{github.workspace}}/server
Right now have a problem that format_coverage
is trying to read files without prefix. I will have to try it locally first and then I will submit PR.
from codeclimate-action.
@MartinNuc , I did a test and got through that part thanks to your suggestion. But, haven't had any luck yet getting format_coverage to work. In fact, I have a few threads on this issue, including a different approach scripting in the CI rather than using an Action. But, all roads for that have resulted in no such file or directory
. Very challenging problem on mono-repositories. What coverageCommand
are you using? Technically, unit testing has already created my /coverage
data. But, it's unclear how things process inside this black box. I haven't dug into the source code yet.
from codeclimate-action.
@MartinNuc Would be super-helpful if you can add these to the README's examples section as well.
from codeclimate-action.
Related Issues (20)
- GitHub Actions failing with: File not found: '/home/runner/work/_actions/paambaati/codeclimate-action/v3.1.0/lib/main.js' HOT 7
- Incorrect branch and sha sent to Code Climate when workflow triggered by `pull_request_target` event HOT 2
- Error when downloading action HOT 3
- TypeError: Cannot read properties of undefined (reading 'split') HOT 4
- GithubActions: couldn't load committed at from ENV, trying git.. HOT 2
- v3 fails to load HOT 4
- Clean up generated files HOT 3
- Detected dubious ownership in repository HOT 15
- Our CI has started failing just today with an unusual error HOT 4
- Support arm64 machine HOT 5
- could we add windows support? HOT 9
- Question: why do we have to use specific version instead of major tag? HOT 1
- Add "can't find this pattern" debug to getLocationLines HOT 1
- CC Reporter GPG signature verfication failed! HOT 1
- Support for node 20.x HOT 2
- Run paambaati/[email protected] Error: File not found: '/home/runner/work/_actions/paambaati/codeclimate-action/v4.0.0/lib/main.js' HOT 2
- As the v5 got released, v4 broke HOT 1
- Allow `coverageCommand` to be a multiline script?
- Update from Node.js 16 to Node.js 20 HOT 7
- Does not run on macos-14 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeclimate-action.