Skip to content

Verify that coverage-reporter-version option is recognized #229

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

Merged
merged 6 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
action: [report, done, build-number-report, build-number-done] # Note: We're also testing 'install' since it's implicit in each action
fail_on_error: [true, false]
coverage_reporter_version: ['v0.6.14', 'latest', '']
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -40,10 +41,11 @@ jobs:
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-error: ${{ matrix.fail_on_error }}
debug: true
fail-on-error: ${{ matrix.fail_on_error }}
build-number: ${{ (matrix.action == 'build-number-report' || matrix.action == 'build-number-done') && github.sha || '' }} # Only set 'build-number' to `${{ github.sha }}` when testing `build-number-report` or `build-number-done`
parallel-finished: ${{ matrix.action == 'done' || matrix.action == 'build-number-done' }} # Only set `parallel-finished` to `true` when testing `done` or `build-number-done`
coverage-reporter-version: ${{ matrix.coverage_reporter_version != '' && matrix.coverage_reporter_version || '' }}
env:
CI: true
continue-on-error: ${{ matrix.fail_on_error }}
continue-on-error: true
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ runs:
shell: bash
run: |
echo "The coverage-reporter-version parameter is not available on macOS." >&2
exit 1
if [[ "${{ inputs.fail-on-error }}" == "true" ]]; then
exit 1
else
exit 0
fi

- name: Install coveralls reporter (Linux)
if: runner.os == 'Linux'
Expand All @@ -120,7 +124,7 @@ runs:
cd ~/bin/

# Determine which version of coverage-reporter to download
if [ "$COVERAGE_REPORTER_VERSION" == "latest" ]; then
if [ -z "$COVERAGE_REPORTER_VERSION" ] || [ "$COVERAGE_REPORTER_VERSION" == "latest" ]; then
asset_path="latest/download"
else
asset_path="download/${COVERAGE_REPORTER_VERSION}"
Expand Down Expand Up @@ -167,7 +171,7 @@ runs:
# Try to download the binary and checksum file
New-Item -Path $env:HOME\bin -ItemType directory -Force
Push-Location $env:HOME\bin
if($env:COVERAGE_REPORTER_VERSION -eq "latest") {
if ([string]::IsNullOrEmpty($env:COVERAGE_REPORTER_VERSION) -or $env:COVERAGE_REPORTER_VERSION -eq "latest") {
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"
} else {
Expand Down
Loading