Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Jul 15, 2024
1 parent 41174f3 commit f6a0fc3
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
A GitHub action for shunit2 and kcov

[![Build docker image](https://github.com/sudo-bot/action-shunit2/actions/workflows/build.yml/badge.svg)](https://github.com/sudo-bot/action-shunit2/actions/workflows/build.yml)
[![test all binaries](https://github.com/sudo-bot/action-shunit2/actions/workflows/shunit2-kcov.yml/badge.svg)](https://github.com/sudo-bot/action-shunit2/actions/workflows/shunit2-kcov.yml)
[![Test the action](https://github.com/sudo-bot/action-shunit2/actions/workflows/shunit2-kcov.yml/badge.svg)](https://github.com/sudo-bot/action-shunit2/actions/workflows/shunit2-kcov.yml)
[![codecov](https://codecov.io/gh/sudo-bot/action-shunit2/graph/badge.svg?token=3O47F7U6N6)](https://codecov.io/gh/sudo-bot/action-shunit2)

You can find the image on [Docker Hub](https://hub.docker.com/r/botsudo/action-shunit2)

Expand All @@ -14,6 +15,22 @@ The Kcov [website](https://github.com/SimonKagstrom/kcov#readme)

## Example usage

### test.sh

```sh
#!/bin/sh

testEquality() {
assertEquals 1 1
}

. shunit2
```

### `.github/workflows/<name>.yml`

#### Example usage with tests

```yml
name: run tests

Expand All @@ -30,10 +47,10 @@ jobs:
- name: run my tests
uses: sudo-bot/action-shunit2@latest
with:
cli: "./tests/run.sh"
cli: "./tests/test.sh"
```
## Example usage with a script and kcov
#### Example usage with a script and kcov
```yml
name: run tests
Expand All @@ -48,8 +65,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: run my tests

- name: Run tests with kcov coverage
uses: sudo-bot/action-shunit2@latest
with:
cli: "kcov ./build/coverage ./tests/test.sh"
cli: "kcov --dump-summary ./coverage ./tests/run.sh"

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/
fail_ci_if_error: true
```

0 comments on commit f6a0fc3

Please sign in to comment.