diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 22f4c8c2592f..7a42a7508d59 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -1,5 +1,3 @@ -$ErrorActionPreference = 'Continue' - # Download a file and retry upon failure. This looks like # an infinite loop but CI-level timeouts will kill it function Download-File-With-Retries { diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index 2bf01e7de0a7..fd0e9f95a5e4 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -1,5 +1,3 @@ -$ErrorActionPreference = 'Continue' - function Check-Output { param( [bool]$success ) if (!$success) { diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 38cf4a9adea4..3a10698cccee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,11 +78,19 @@ jobs: run: conda init powershell - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: cmd + shell: pwsh env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" TASK: "${{ matrix.task }}" run: | - set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% - powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%\.ci\test_windows.ps1 + $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE + Invoke-Expression -Command "$env:GITHUB_WORKSPACE\.ci\test_windows.ps1" + +# set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% +# powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%\.ci\test_windows.ps1 + +# possible links +# * https://github.com/PowerShell/PowerShell/issues/4002 +# * https://github.com/PowerShell/PowerShell/issues/3996 +# * https://www.activestate.com/blog/optimizing-ci-cd-pipelines-in-github-actions/