Skip to content

Commit eccb0b0

Browse files
committed
Update test.yml
1 parent 34bbb1e commit eccb0b0

File tree

1 file changed

+13
-62
lines changed

1 file changed

+13
-62
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -19,76 +19,27 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
config:
22-
- {os: windows-latest, r: 'release', rust: 'stable-msvc', rtools-version: "44"}
23-
- {os: windows-latest, r: 'devel', rust: 'stable-msvc', rtools-version: "43"}
24-
- {os: macOS-latest, r: 'release', rust: 'stable' }
25-
- {os: ubuntu-latest, r: 'release', rust: 'stable' }
26-
- {os: ubuntu-latest, r: 'devel', rust: 'stable' }
22+
- {os: 'macos-latest', r: 'release', rust: 'stable'}
23+
- {os: 'windows-latest', r: 'release', rust: 'stable'}
24+
- {os: 'ubuntu-latest', r: 'release', rust: 'stable'}
25+
- {os: 'ubuntu-latest', r: 'devel', rust: 'stable', http-user-agent: 'release'}
26+
- {os: 'ubuntu-latest', r: 'release', rust: 'nightly'}
27+
- {os: 'ubuntu-24.04-arm', r: 'release', rust: 'stable', rspm: 'false'}
2728

2829
env:
2930
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3031

3132
steps:
3233
- uses: actions/checkout@v4
33-
34-
- name: Set up R
35-
uses: r-lib/actions/setup-r@v2
36-
with:
37-
r-version: ${{ matrix.config.r }}
38-
rtools-version: ${{ matrix.config.rtools-version }}
39-
# TODO: enable RSPM when all the packages are available
40-
use-public-rspm: false
41-
42-
- name: Rust toolchain
43-
uses: dtolnay/rust-toolchain@nightly
44-
45-
- name: Configure Windows
46-
if: startsWith(runner.os, 'Windows')
47-
run: |
48-
$rtools_home = "C:\rtools${{ matrix.config.rtools-version }}"
49-
50-
# c.f. https://github.com/wch/r-source/blob/f1501504df8df1668a57d3a1b6f80167f24441d3/src/library/profile/Rprofile.windows#L70-L71
51-
echo "${rtools_home}\x86_64-w64-mingw32.static.posix\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append ;
52-
echo "${rtools_home}\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append ;
53-
echo "$(Rscript.exe -e 'cat(normalizePath(R.home()))')\bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append ;
5434

55-
# Add target
56-
rustup target add x86_64-pc-windows-gnu
57-
echo "BUILD_TARGETS=x86_64-pc-windows-gnu" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append ;
35+
- uses: dtolnay/rust-toolchain@nightly
36+
if: matrix.config.rust == 'nightly'
5837

59-
# The following lines add two tweaks:
60-
#
61-
# 1. Change the linker name to "x86_64-w64-mingw32.static.posix-gcc.exe".
62-
# 2. Add empty libgcc_s.a and libgcc_eh.a, and add them to the compiler's
63-
# library search paths via `LIBRARY_PATH` envvar.
64-
#
65-
# The first tweak is needed because Rtools42 doesn't contain
66-
# "x86_64-w64-mingw32-gcc," which `rustc` uses as the default linker
67-
# for the `x86_64-pc-windows-gnu` target.
68-
#
69-
# If we use the Rtools' toolchain, the second tweak is also required.
70-
# `rustc` adds `-lgcc_eh` and `-lgcc_s` flags to the compiler, but
71-
# Rtools' GCC doesn't have `libgcc_eh` or `libgcc_s` due to the
72-
# compilation settings. So, in order to please the compiler, we need
73-
# to add empty `libgcc_eh` or `libgcc_s` to the library search paths.
74-
#
75-
# For more details, please refer to https://github.com/r-windows/rtools-packages/blob/2407b23f1e0925bbb20a4162c963600105236318/mingw-w64-gcc/PKGBUILD#L313-L316
76-
77-
New-Item -Path libgcc_mock -Type Directory
78-
New-Item -Path libgcc_mock\libgcc_eh.a -Type File
79-
New-Item -Path libgcc_mock\libgcc_s.a -Type File
80-
81-
New-Item -Path .cargo -ItemType Directory -Force
82-
$pwd_slash = echo "${PWD}" | % {$_ -replace '\\','/'}
83-
@"
84-
[target.x86_64-pc-windows-gnu]
85-
linker = "x86_64-w64-mingw32.static.posix-gcc.exe"
86-
87-
[env]
88-
LIBRARY_PATH = "${pwd_slash}/libgcc_mock"
89-
"@ | Out-File -FilePath .cargo/config.toml -Encoding utf8 -Append ;
90-
env:
91-
RUST_TOOLCHAIN: ${{ matrix.config.rust }}
38+
- uses: r-lib/actions/setup-r@v2
39+
with:
40+
r-version: ${{ matrix.config.r }}
41+
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: ${{ matrix.config.rspm || 'true' }}
9243

9344
- name: Test crate
9445
run: |

0 commit comments

Comments
 (0)