Skip to content

Commit 23b7fa1

Browse files
committed
Further remove manually added debugging lines to rely solely on shell-based debugging flags. Add comments for parallel setup steps on each OS, more helpful now with the more verbose conditionals we added to check that each step succeeds.
1 parent bb6c0c4 commit 23b7fa1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Diff for: action.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ runs:
8383
# Enable debugging if 'debug' is true
8484
[ "${{ inputs.debug }}" == "true" ] && set -x
8585
86+
# Try to install coverage-reporter via Homebrew
8687
brew tap coverallsapp/coveralls --quiet
8788
brew install coveralls --quiet
8889
@@ -115,15 +116,13 @@ runs:
115116
mkdir -p ~/bin/
116117
cd ~/bin/
117118
119+
# Determine which version of coverage-reporter to download
118120
if [ "$COVERAGE_REPORTER_VERSION" == "latest" ]; then
119121
asset_path="latest/download"
120122
else
121123
asset_path="download/${COVERAGE_REPORTER_VERSION}"
122124
fi
123125
124-
# Debugging output to verify asset path
125-
echo "Using asset path: $asset_path"
126-
127126
# Try to download the binary and checksum file
128127
if ! curl -sLO "https://github.com/coverallsapp/coverage-reporter/releases/${asset_path}/coveralls-linux.tar.gz" ||
129128
! curl -sLO "https://github.com/coverallsapp/coverage-reporter/releases/${asset_path}/coveralls-checksums.txt"; then
@@ -132,35 +131,37 @@ runs:
132131
exit 1
133132
fi
134133
135-
# Verify the downloaded binary
134+
# Try to verify the downloaded binary
136135
if ! grep coveralls-linux.tar.gz coveralls-checksums.txt | sha256sum --check; then
137136
echo "Checksum verification failed (Linux)."
138137
[ "${{ inputs.fail-on-error }}" == "false" ] && exit 0
139138
exit 1
140139
fi
141140
142-
# Extract the tar.gz file
143141
tar -xzf coveralls-linux.tar.gz
144142
145-
rm coveralls-checksums.txt
146-
echo ~/bin >> $GITHUB_PATH
147-
148143
# Check if the binary exists
149144
if [ ! -f ~/bin/coveralls ]; then
150145
echo "Coveralls binary not found after extraction (Linux)."
151146
exit 1
152147
fi
153148
149+
# Cleanup
150+
rm coveralls-checksums.txt
151+
echo ~/bin >> $GITHUB_PATH
152+
154153
- name: Install coveralls reporter (Windows)
155154
if: startsWith(runner.os, 'Windows')
156155
env:
157156
COVERAGE_REPORTER_VERSION: ${{ inputs.coverage-reporter-version }}
158157
shell: pwsh
159158
run: |
159+
# Enable debugging if 'debug' is true
160160
if ("${{ inputs.debug }}" -eq "true") {
161161
Set-PSDebug -Trace 1
162162
}
163163
164+
# Try to download the binary and checksum file
164165
New-Item -Path $env:HOME\bin -ItemType directory -Force
165166
Push-Location $env:HOME\bin
166167
if($env:COVERAGE_REPORTER_VERSION -eq "latest") {
@@ -171,6 +172,7 @@ runs:
171172
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/download/$env:COVERAGE_REPORTER_VERSION/coveralls-checksums.txt" -OutFile "sha256sums.txt"
172173
}
173174
175+
# Try to verify the downloaded binary
174176
if ((Get-FileHash coveralls.exe).Hash -ne (Get-Content sha256sums.txt | Select-String 'windows.exe' | ForEach-Object { ($_ -split "\s+")[0] })) {
175177
Write-Host "Checksum verification failed (Windows)."
176178
exit 1
@@ -182,6 +184,7 @@ runs:
182184
exit 1
183185
}
184186
187+
# Cleanup
185188
Remove-Item sha256sums.txt -Force
186189
echo $env:HOME\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
187190

0 commit comments

Comments
 (0)