Skip to content

Commit

Permalink
Add deprecation notice to README (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar-deepsource authored Dec 19, 2022
1 parent c443580 commit 45288ed
Showing 1 changed file with 51 additions and 2 deletions.
53 changes: 51 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,59 @@ GitHub Action that enables you to upload your test coverage data to DeepSource e

If you're not using DeepSource yet, [get started for free](https://deepsource.io/signup?utm_source=githubmarketplace&utm_medium=organic).

## Notice

If you’re using the Test coverage action, we recommend switching to using the DeepSource CLI directly.
To do this, rather than using the `test-coverage-action` step, you can do the following:

```yaml
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

# Run your tests here ...

- name: Report test-coverage to DeepSource
run: |
# Install the CLI
curl https://deepsource.io/cli | sh
# Send the report to DeepSource
./bin/deepsource report --analyzer test-coverage --key <language> --value-file <path/to/coverage/file>
```
If you want to continue using the Test coverage action, please add a step before the test coverage action, to add a
`safe.directory` parameter to your `.gitconfig`:

```yaml
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 50
ref: ${{ github.event.pull_request.head.sha }}
# ADD THIS STEP
- name: Add git safe.directory for container
run: |
mkdir -p /home/runner/work/_temp/_github_home
printf "[safe]\ndirectory = /github/workspace" > /home/runner/work/_temp/_github_home/.gitconfig
- name: Report test-coverage to DeepSource
uses: deepsourcelabs/test-coverage-action@master
with:
... The rest of your config is explained in Usage section.
```

Read this [Discuss post](https://discuss.deepsource.io/t/breaking-deepsource-test-coverage-github-action/507) for more information.

## Usage

This Action assumes that the coverage file has already been generated after the tests have run. To integrate it in your workflow, define a step which refers to this Action in your `workflow.yml` file. We recommend that you use `@master`as the ref.
This Action assumes that the coverage file has already been generated after the tests have run. To integrate it in your workflow, define a step which refers to this Action in your `workflow.yml` file. We recommend that you use `@master` as the ref.

Ensure that you have added the `DEEPSOURCE_DSN` secret in your GitHub repository. It is available under **Settings → Reporting tab** of the repository page on DeepSource.

```yaml
steps:
Expand All @@ -25,7 +74,7 @@ The possible inputs to this action are:

* `key` (string, **required**): Programming language shortcode for which coverage is reported. Allowed values are: `python`, `go`.
* `coverage-file` (string, **required**): Path to the coverage data file. e. g. `coverage.xml`
* `dsn` (string, **required**): DeepSource DSN of this repository. It is available under **Settings → Reporting tab** of the repository page on DeepSource.
* `dsn` (string, **required**): DeepSource DSN of this repository.
* `fail-ci-on-error` (boolean): Should the CI build fail if there is an error while uploading the report to DeepSource? Allowed values are: `true`, `false`. This is set to `false` by default.

## License
Expand Down

0 comments on commit 45288ed

Please sign in to comment.