From 3b7078ee895f74fc267b7b267c88211df59fa816 Mon Sep 17 00:00:00 2001 From: Valentin Kiselev Date: Mon, 4 Sep 2023 11:46:24 +0300 Subject: [PATCH] feat: use pwsh for windows runner (#188) * feat: use pwsh for windows runners * fix: check 2 approaches --- action.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/action.yml b/action.yml index 85bb2498..d307eaeb 100644 --- a/action.yml +++ b/action.yml @@ -97,20 +97,19 @@ runs: - name: Install coveralls reporter (Windows) if: startsWith(runner.os, 'Windows') - shell: bash + shell: pwsh run: | - mkdir -p ~/bin/ - cd ~/bin/ - curl -sLO https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.zip - curl -sLO https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-checksums.txt - cat coveralls-checksums.txt | grep coveralls-windows.zip | sha256sum --check - zcat coveralls-windows.zip > coveralls.exe - rm coveralls-checksums.txt - echo ~/bin >> $GITHUB_PATH + New-Item -Path $env:HOME\bin -ItemType directory + 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" + (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 - name: Done report if: inputs.parallel-finished == 'true' - shell: bash + shell: ${{ startsWith(runner.os, 'Windows') && 'pwsh' || 'bash' }} run: >- coveralls done ${{ inputs.debug == 'true' && '--debug' || '' }} @@ -128,7 +127,7 @@ runs: - name: Coverage report if: inputs.parallel-finished != 'true' - shell: bash + shell: ${{ startsWith(runner.os, 'Windows') && 'pwsh' || 'bash' }} run: >- coveralls report ${{ inputs.debug == 'true' && '--debug' || '' }}