- This action leverages the power of AWS S3 to persist code coverage data between runs.
- S3 Bucket must enable public access in order to make badges publicly available.
- It is recommended to use a dedicated bucket for this action to avoid any conflicts and possible data loss.
Sole the badge files are public, all other coverage data is kept private.
on:
pull_request:
types: [closed]
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: SamuelCabralCruz/free-code-coverage/[email protected]
with:
bucket-name: <bucket-name>
project-name: <project-name>
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
This can easily be adapted using a matrix strategy when using the action for multiple projects inside same repository.
- AWS_ACCESS_KEY_ID
- AWS IAM User Access Key ID with S3 admin rights
- Should be exposed via your repository secrets
- AWS_SECRET_ACCESS_KEY
- AWS IAM User Secret Access Key with S3 admin rights
- Should be exposed via your repository secrets
- AWS_REGION (optional - default: 'us-east-1')
- bucket-name
- S3 bucket name to be used to persist code coverage data between runs.
- project-name
- Lower kebab case string (lower-kebab-case-string) allowing to store action's data from multiple projects/repositories without collisions in the same bucket.
To add badges to your README
or any other Markdown file, you can simply copy/paste and fill in the template below:
![](https://<bucket-name>.s3.amazonaws.com/badge-<project-name>-<branch-name>.svg)
- You will need to provide values for:
- bucket-name
- project-name
- branch-name
- For encoding reasons, need to replace any
/
by-
in the branch name - Would normally be the name of your repository's default branch name
main
ormaster
. - Could also be the name of a branch that is never destined to be closed (ex:
develop
if you use Gitflow workflow).
- For encoding reasons, need to replace any
Not Applicable.