@@ -83,11 +83,17 @@ runs:
83
83
brew tap coverallsapp/coveralls --quiet
84
84
brew install coveralls --quiet
85
85
86
+ # Check if the binary exists in the expected location
87
+ if [ ! -f /usr/local/bin/coveralls ]; then
88
+ echo "Coveralls binary not found after installation (MacOS)."
89
+ exit 1
90
+ fi
91
+
86
92
- name : Report coverage-reporter-version information for macOS
87
93
if : ${{ runner.os == 'macOS' && inputs.coverage-reporter-version != 'latest' }}
88
94
shell : bash
89
95
run : |
90
- echo "The coverage-reporter-version parameter is not available on macOS" >&2
96
+ echo "The coverage-reporter-version parameter is not available on macOS. " >&2
91
97
exit 1
92
98
93
99
- name : Install coveralls reporter (Linux)
@@ -111,7 +117,7 @@ runs:
111
117
# Try to download the binary and checksum file
112
118
if ! curl -sLO "https://github.com/coverallsapp/coverage-reporter/releases/${asset_path}/coveralls-linux.tar.gz" ||
113
119
! curl -sLO "https://github.com/coverallsapp/coverage-reporter/releases/${asset_path}/coveralls-checksums.txt"; then
114
- echo "Failed to download coveralls binary or checksum."
120
+ echo "Failed to download coveralls binary or checksum (Linux) ."
115
121
[ "${{ inputs.fail-on-error }}" == "false" ] && exit 0
116
122
exit 1
117
123
fi
@@ -124,7 +130,7 @@ runs:
124
130
125
131
# Verify the downloaded binary
126
132
if ! grep coveralls-linux.tar.gz coveralls-checksums.txt | sha256sum --check; then
127
- echo "Checksum verification failed."
133
+ echo "Checksum verification failed (Linux) ."
128
134
[ "${{ inputs.fail-on-error }}" == "false" ] && exit 0
129
135
exit 1
130
136
fi
@@ -141,6 +147,12 @@ runs:
141
147
rm coveralls-checksums.txt
142
148
echo ~/bin >> $GITHUB_PATH
143
149
150
+ # Check if the binary exists
151
+ if [ ! -f ~/bin/coveralls ]; then
152
+ echo "Coveralls binary not found after extraction (Linux)."
153
+ exit 1
154
+ fi
155
+
144
156
- name : Install coveralls reporter (Windows)
145
157
if : startsWith(runner.os, 'Windows')
146
158
env :
@@ -156,22 +168,28 @@ runs:
156
168
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/download/$env:COVERAGE_REPORTER_VERSION/coveralls-windows.exe" -OutFile "coveralls.exe"
157
169
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/download/$env:COVERAGE_REPORTER_VERSION/coveralls-checksums.txt" -OutFile "sha256sums.txt"
158
170
}
159
- (Get-FileHash coveralls.exe).Hash -eq (Get-Content ./sha256sums.txt | Where-Object{$_ -match 'windows.exe'} | ForEach-Object{($_ -split "\s+")[0]})
160
- Remove-Item *.txt -Force
171
+
172
+ if ((Get-FileHash coveralls.exe).Hash -ne (Get-Content sha256sums.txt | Select-String 'windows.exe' | ForEach-Object { ($_ -split "\s+")[0] })) {
173
+ Write-Host "Checksum verification failed (Windows)."
174
+ exit 1
175
+ }
176
+
177
+ # Check if the binary exists
178
+ if (!(Test-Path -Path "$env:HOME\bin\coveralls.exe")) {
179
+ Write-Host "Coveralls binary not found after download and verification (Windows)."
180
+ exit 1
181
+ }
182
+
183
+ Remove-Item sha256sums.txt -Force
161
184
echo $env:HOME\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
162
185
163
186
- name : Done report
164
187
if : inputs.parallel-finished == 'true'
165
188
shell : ${{ startsWith(runner.os, 'Windows') && 'pwsh' || 'bash' }}
166
- run : |
167
- if [ ! -f ~/bin/coveralls ]; then
168
- echo "Coveralls binary not found."
169
- [ "${{ inputs.fail-on-error }}" == "false" ] && exit 0
170
- exit 1
171
- fi
172
- ~/bin/coveralls done \
173
- ${{ inputs.debug == 'true' && '--debug' || '' }} \
174
- ${{ inputs.measure == 'true' && '--measure' || '' }} \
189
+ run : >-
190
+ coveralls done
191
+ ${{ inputs.debug == 'true' && '--debug' || '' }}
192
+ ${{ inputs.measure == 'true' && '--measure' || '' }}
175
193
${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }}
176
194
env :
177
195
COVERALLS_DEBUG : ${{ inputs.debug }}
@@ -186,20 +204,15 @@ runs:
186
204
- name : Coverage report
187
205
if : inputs.parallel-finished != 'true'
188
206
shell : ${{ startsWith(runner.os, 'Windows') && 'pwsh' || 'bash' }}
189
- run : |
190
- if [ ! -f ~/bin/coveralls ]; then
191
- echo "Coveralls binary not found."
192
- [ "${{ inputs.fail-on-error }}" == "false" ] && exit 0
193
- exit 1
194
- fi
195
- ~/bin/coveralls report \
196
- ${{ inputs.debug == 'true' && '--debug' || '' }} \
197
- ${{ inputs.measure == 'true' && '--measure' || '' }} \
198
- ${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }} \
199
- ${{ inputs.allow-empty == 'true' && '--allow-empty' || '' }} \
200
- ${{ inputs.base-path && format('--base-path {0}', inputs.base-path) || '' }} \
201
- ${{ inputs.format && format('--format {0}', inputs.format) || '' }} \
202
- ${{ inputs.file || inputs.path-to-lcov }} \
207
+ run : >-
208
+ coveralls report
209
+ ${{ inputs.debug == 'true' && '--debug' || '' }}
210
+ ${{ inputs.measure == 'true' && '--measure' || '' }}
211
+ ${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }}
212
+ ${{ inputs.allow-empty == 'true' && '--allow-empty' || '' }}
213
+ ${{ inputs.base-path && format('--base-path {0}', inputs.base-path) || '' }}
214
+ ${{ inputs.format && format('--format {0}', inputs.format) || '' }}
215
+ ${{ inputs.file || inputs.path-to-lcov }}
203
216
${{ inputs.files }}
204
217
env :
205
218
COVERALLS_DEBUG : ${{ inputs.debug }}
0 commit comments