To use FlowCov with GitHub Actions, you need to integrate it into your existing workflow, after the build step. In this document we will outline the steps required to do so.
You should always save your credentials, in this case your API Key and optionally your Repository ID, in GitHub Secrets. That way everyone can use it, but it's not possible to copy and abuse them. They will also be censored in the build logs.
You can find the required steps to create new secrets in the GitHub documentation. In this document, we will assume that you stored them into the following secrets:
Integrate it into an existing workflow
You can use the following snippet as an additional step in your existing workflow. Remember that it has to be executed after you run your tests.
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 workflow
If you don't have a workflow defined yet, you can use the following instead. Store it as a new file called
.github/workflows/build.yaml in your repository's root directory. It will then automatically be run the next time you push a commit.
It builds your source code using Ubuntu, Java 11, and Gradle as build environment. It then executes the script as described above. For more details on how to define your custom actions, see the GitHub documentation.