Skip to content

Commit 3b7078e

Browse files
authored
feat: use pwsh for windows runner (#188)
* feat: use pwsh for windows runners * fix: check 2 approaches
1 parent 95b1a23 commit 3b7078e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

action.yml

+10-11
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,19 @@ runs:
9797
9898
- name: Install coveralls reporter (Windows)
9999
if: startsWith(runner.os, 'Windows')
100-
shell: bash
100+
shell: pwsh
101101
run: |
102-
mkdir -p ~/bin/
103-
cd ~/bin/
104-
curl -sLO https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.zip
105-
curl -sLO https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-checksums.txt
106-
cat coveralls-checksums.txt | grep coveralls-windows.zip | sha256sum --check
107-
zcat coveralls-windows.zip > coveralls.exe
108-
rm coveralls-checksums.txt
109-
echo ~/bin >> $GITHUB_PATH
102+
New-Item -Path $env:HOME\bin -ItemType directory
103+
Push-Location $env:HOME\bin
104+
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.exe" -OutFile "coveralls.exe"
105+
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-checksums.txt" -OutFile "sha256sums.txt"
106+
(Get-FileHash coveralls.exe).Hash -eq (Get-Content ./sha256sums.txt | Where-Object{$_ -match 'windows.exe'} | ForEach-Object{($_ -split "\s+")[0]})
107+
Remove-Item *.txt -Force
108+
echo $env:HOME\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
110109
111110
- name: Done report
112111
if: inputs.parallel-finished == 'true'
113-
shell: bash
112+
shell: ${{ startsWith(runner.os, 'Windows') && 'pwsh' || 'bash' }}
114113
run: >-
115114
coveralls done
116115
${{ inputs.debug == 'true' && '--debug' || '' }}
@@ -128,7 +127,7 @@ runs:
128127

129128
- name: Coverage report
130129
if: inputs.parallel-finished != 'true'
131-
shell: bash
130+
shell: ${{ startsWith(runner.os, 'Windows') && 'pwsh' || 'bash' }}
132131
run: >-
133132
coveralls report
134133
${{ inputs.debug == 'true' && '--debug' || '' }}

0 commit comments

Comments
 (0)