To use FlowCov with CircleCI, you need to integrate it into your existing build pipeline, as one step after the build has finished. In this document we will outline the steps required to do so.
You should only ever store your credentials, in this case your API Key and optionally your Repository ID, as secretly stored environment variables. That way everyone can use it, but it's not possible to copy and abuse them.
You can find the required steps to create a context containing secret environment variables in the CircleCI documentation. In this document, we will assume that you stored them as environment variables with the following names:
Integrate it into an existing pipeline
You can use the following snippet and integrate it into your existing build pipeline to upload the coverage reports after the build has finished. Remember to reference the context containing your environment variables created above.
This snippet downloads the latest version of the script, and executes it using the API key and repository ID provided in the environment variables described above.
Creating a new pipeline
If you don't have a pipeline definition yet, you can use the following instead. Store it as a new file called
.circleci/config.yml in your repository's root directory. It will then automatically be run the next time you push a commit, if you have connected your repository with CircleCI. Consult the CircleCI documentation for more information on that topic.
It builds your source code first, then executes the script as described above.