Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: reporter-version #191

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -32,6 +32,7 @@ The action's step needs to run after your test suite has outputted an LCOV file.
| `debug` | _optional_ | Default: `false`. Set to `true` to enable debug logging. |
| `measure` | _optional_ | Default: `false`. Set to `true` to enable time time measurement logging. |
| `fail-on-error` | _optional_ | Default: `true`. Set to `false` to avoid CI failure when upload fails due to any errors. |
| `reporter-version` | _optional_ | Default: `latest`. Specify reporter version/release, for example: `v0.6.4`. [Releases](https://github.com/coverallsapp/coverage-reporter/releases/) |

### Outputs:

Expand Down
18 changes: 14 additions & 4 deletions action.yml
Expand Up @@ -66,6 +66,10 @@ inputs:
description: 'Whether to fail (exit code 1) on any issues while uploading the coverage'
required: false
default: true
reporter-version:
description: 'Specify custom version of coverage-reporter, for example: `v0.6.4`'
required: false
default: false
outputs:
coveralls-api-result:
description: 'Result status of Coveralls API post.'
Expand All @@ -74,7 +78,13 @@ branding:
icon: 'percent'
runs:
using: 'composite'

steps:
- id: reporter-version
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nebolsin! I'm working on https://linear.app/coveralls/issue/SR-69/ability-to-select-version-of-coverage-reporter-public-issue-170. What do you think about using other actions in our workflows?

uses: pozetroninc/github-action-get-latest-release@master
with:
repository: coverallsapp/coverage-reporter

- name: Install coveralls reporter (macOS)
if: runner.os == 'macOS'
shell: bash
Expand All @@ -88,8 +98,8 @@ runs:
run: |
mkdir -p ~/bin/
cd ~/bin/
curl -sLO https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-linux.tar.gz
curl -sLO https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-checksums.txt
curl -sLO https://github.com/coverallsapp/coverage-reporter/releases/download/${{ inputs.reporter-version == 'false' && steps.reporter-version.outputs.release || inputs.reporter-version }}/coveralls-linux.tar.gz
curl -sLO https://github.com/coverallsapp/coverage-reporter/releases/download/${{ inputs.reporter-version == 'false' && steps.reporter-version.outputs.release || inputs.reporter-version }}/coveralls-checksums.txt
cat coveralls-checksums.txt | grep coveralls-linux.tar.gz | sha256sum --check
tar -xzf coveralls-linux.tar.gz
rm coveralls-checksums.txt
Expand All @@ -101,8 +111,8 @@ runs:
run: |
New-Item -Path $env:HOME\bin -ItemType directory -Force
Push-Location $env:HOME\bin
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.exe" -OutFile "coveralls.exe"
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-checksums.txt" -OutFile "sha256sums.txt"
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/download/${{ inputs.reporter-version == 'false' && steps.reporter-version.outputs.release || inputs.reporter-version }}/coveralls-windows.exe" -OutFile "coveralls.exe"
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/download/${{ inputs.reporter-version == 'false' && steps.reporter-version.outputs.release || inputs.reporter-version }}/coveralls-checksums.txt" -OutFile "sha256sums.txt"
(Get-FileHash coveralls.exe).Hash -eq (Get-Content ./sha256sums.txt | Where-Object{$_ -match 'windows.exe'} | ForEach-Object{($_ -split "\s+")[0]})
Remove-Item *.txt -Force
echo $env:HOME\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Expand Down