Skip to content

Commit

Permalink
simplify code and update docs (#9)
Browse files Browse the repository at this point in the history
* rename workspace to working-directory
* update readme
* cache binary in temporary directory
* remove entrypoint.sh
* add cache test
* remove cache
  • Loading branch information
septs committed Oct 17, 2020
1 parent 4b58d89 commit e31779e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Run gcov2lcov-action
uses: ./
with:
workspace: testdata
working-directory: testdata
- name: Diff
run: diff -y coverage_expected.lcov coverage.lcov
working-directory: testdata
20 changes: 15 additions & 5 deletions README.md
Expand Up @@ -10,11 +10,19 @@ uses [gcov2lcov](https://github.com/jandelgado/gcov2lcov) under the hood.

### `infile`

**Required** Name of the go coverage file. Default `coverage.out`.
**Optional** Name of the go coverage file. Default `coverage.out`.

### `outfile`

**Required** Name of the lcov file to write. Default `coverage.lcov`.
**Optional** Name of the lcov file to write. Default `coverage.lcov`.

### `version`

**Optional** Name of the specific gcov2lcov program version. Default `latest`.

### `working-directory`

**Optional** Name of the change to specific working-directory.

## Outputs

Expand All @@ -23,10 +31,12 @@ No outputs.
## Example usage

```yaml
uses: jandelgado/gcov2lcov-action@v1.0.4
uses: jandelgado/gcov2lcov-action@v1.0.5
with:
infile: coverage.out
outfile: coverage.lcov
infile: coverage.out # optional, default filename is `coverage.out`
outfile: coverage.lcov # optional, default filename is `coverage.lcov`
version: v1.0.4 # optional, use specific `gcov2lcov` release version
working-directory: testdata # optional, change working directory
```

### Full example
Expand Down
21 changes: 11 additions & 10 deletions action.yml
Expand Up @@ -14,19 +14,20 @@ inputs:
version:
description: "gcov2lcov version"
required: true
default: v1.0.4
workspace:
description: "working directory"
default: latest
working-directory:
description: "change working directory"
required: false

runs:
using: composite
steps:
- name: Run gcov2lcov
run: ${{ github.action_path }}/entrypoint.sh
shell: bash
- shell: bash
run: 'set -x && curl -sLf "${RELEASE}/${NAME}.tar.gz" | tar zxf - --strip 1'
working-directory: /tmp
env:
INFILE: ${{ inputs.infile }}
OUTFILE: ${{ inputs.outfile }}
VERSION: ${{ inputs.version }}
WORKSPACE: ${{ inputs.workspace }}
NAME: "gcov2lcov-linux-amd64"
RELEASE: "https://github.com/jandelgado/gcov2lcov/releases/${{inputs.version}}/download"
- shell: bash
run: set -x && /tmp/gcov2lcov-linux-amd64 -infile "${{ inputs.infile }}" -outfile "${{ inputs.outfile }}"
working-directory: ${{ inputs.working-directory }}
9 changes: 0 additions & 9 deletions entrypoint.sh

This file was deleted.

0 comments on commit e31779e

Please sign in to comment.