Skip to content

Commit 0fe6663

Browse files
committed
Skip if installed
1 parent b2ee6a7 commit 0fe6663

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

.github/workflows/main.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,17 @@ jobs:
4646
run: |
4747
$ARCH = if ('${{ matrix.os }}' -eq 'windows-11-arm') { 'aarch64' } else { 'x86_64' }
4848
$RTOOLS = if ('${{ matrix.os }}' -eq 'windows-11-arm') { "rtools45-$ARCH" } else { 'rtools45' }
49-
echo "ARCH=$ARCH" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
50-
echo "RTOOLS=$RTOOLS" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
51-
Invoke-WebRequest `
52-
-Uri https://github.com/r-hub/rtools45/releases/download/latest/$RTOOLS.exe `
53-
-Headers @{ 'Authorization' = "Bearer ${{ secrets.GITHUB_TOKEN }}" } `
54-
-OutFile "$RTOOLS.exe"
5549
56-
- name: Install Rtools45
57-
if: runner.os == 'Windows'
58-
run: |
59-
Start-Process -FilePath "$env:RTOOLS.exe" -ArgumentList "/install /norestart /verysilent /SUPPRESSMSGBOXES" -NoNewWindow -Wait
60-
echo "C:/$env:RTOOLS/usr/bin;C:/$env:RTOOLS/$env:ARCH-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
50+
# Installation will hang if the toolchain is already installed
51+
if (-Not Test-Path -Path "$RTOOLS") {
52+
Invoke-WebRequest `
53+
-Uri https://github.com/r-hub/rtools45/releases/download/latest/$RTOOLS.exe `
54+
-Headers @{ 'Authorization' = "Bearer ${{ secrets.GITHUB_TOKEN }}" } `
55+
-OutFile "$RTOOLS.exe"
56+
Start-Process -FilePath "$RTOOLS.exe" -ArgumentList "/install /norestart /verysilent /SUPPRESSMSGBOXES" -NoNewWindow -Wait
57+
}
58+
59+
echo "C:/$RTOOLS/usr/bin;C:/$RTOOLS/$ARCH-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
6160
echo "$(pwd)/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
6261
6362
- name: Build Math libs

0 commit comments

Comments
 (0)