We have this setup:
- code in github with pr and ci integration in vsts
- building a .net web api with msbuild on a job, in a hosted vsts agent
- the build artifacts are then downloaded (in the same pipeline) in 5 different self hosted vsts agents
- we deploy locally the artifacts and run integration tests with coverage enabled
We need SonarCloud integration.
It is our understanding that we should use the vsts tasks to analyze the code and report coverage like this:
- prepare and specify the coverage files
- run analysis
In our context, in order to accommodate both our existing workflow and the SonarCloud tasks what we did was to add a final vsts job, that waits for all the test agents to finish and publish the coverage as artifacts; then we collect on the final jobs all coverage file, run prepare, build (again) and publish.
It is working, but recompiling adds unnecessary time to our builds (especially PRs). This is at least 10 minutes.
ideally we would maybe run the SonarCloud analysis on the first step , and then, at the end, we would just update the analysis with code coverage and test results.
Is this possible ? Is there another way to minimize the build/analyze/publish time ?
Thank you very much,