1
- name : Windows Rtools44
1
+ # Note that the workflows below use Powershell (pwsh) as they were originally written for Windows runners.
2
+ name : Rtools & ARM64 CI
2
3
3
4
on :
4
5
pull_request :
@@ -20,101 +21,28 @@ concurrency:
20
21
21
22
jobs :
22
23
prim-rev :
23
- name : prim and rev tests
24
- runs-on : windows-latest
24
+ name : ${{ matrix.config.label }} tests (${{ matrix.os }})
25
+ runs-on : ${{ matrix.os }}
26
+ strategy :
27
+ fail-fast : false
28
+ matrix :
29
+ os : [windows-latest, ubuntu-24.04-arm]
30
+ config : [
31
+ { label: misc, tests: 'test/unit/*_test.cpp test/unit/math/*_test.cpp test/unit/math/memory' },
32
+ { label: prim, tests: 'test/unit/math/prim' },
33
+ { label: rev, tests: 'test/unit/math/rev' },
34
+ { label: fwd, tests: 'test/unit/math/fwd' },
35
+ { label: 'non-fun mix', tests: 'test/unit/math/mix/core test/unit/math/mix/meta test/unit/math/mix/*_test.cpp' }
36
+ ]
25
37
26
38
steps :
27
39
- uses : actions/checkout@v4
28
40
- uses : actions/setup-python@v5
29
41
with :
30
42
python-version : ' 3.x'
31
- - uses : r-lib/actions/setup-r@v2
32
- with :
33
- r-version : ' release'
34
- rtools-version : ' 44'
35
43
36
- - name : Set path for Rtools44
37
- if : runner.os == 'Windows'
38
- run : echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
39
-
40
- - name : Build Math libs
41
- shell : powershell
42
- run : |
43
- make -f make/standalone math-libs -j2
44
- - name : Add TBB to PATH
45
- shell : powershell
46
- run : echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
47
- - name : Run prim and rev unit tests
48
- shell : powershell
49
- run : |
50
- python.exe runTests.py -j2 test/unit/*_test.cpp
51
- python.exe runTests.py -j2 test/unit/math/*_test.cpp
52
- python.exe runTests.py -j2 test/unit/math/prim
53
- python.exe runTests.py -j2 test/unit/math/rev
54
- python.exe runTests.py -j2 test/unit/math/memory
55
-
56
- - name : Upload gtest_output xml
57
- uses : actions/upload-artifact@v4
58
- if : failure()
59
- with :
60
- name : gtest_outputs_xml
61
- path : ' **/*_test.xml'
62
-
63
- fwd-non-fun-mix :
64
- name : fwd tests and non-fun mix tests
65
- runs-on : windows-latest
66
-
67
- steps :
68
- - uses : actions/checkout@v4
69
- - uses : actions/setup-python@v5
70
- with :
71
- python-version : ' 3.x'
72
44
- uses : r-lib/actions/setup-r@v2
73
- with :
74
- r-version : ' release'
75
- rtools-version : ' 44'
76
-
77
- - name : Set path for Rtools44
78
45
if : runner.os == 'Windows'
79
- run : echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
80
-
81
- - name : Build Math libs
82
- shell : powershell
83
- run : |
84
- make -f make/standalone math-libs -j2
85
- - name : Add TBB to PATH
86
- shell : powershell
87
- run : echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
88
- - name : Disable running fwd/mix tests
89
- shell : powershell
90
- run : echo "CXXFLAGS+= -DSTAN_MATH_TESTS_REV_ONLY" | Out-File -Append -FilePath make/local -Encoding utf8
91
- - name : Run fwd unit tests and all the mix tests except those in mix/fun
92
- shell : powershell
93
- run : |
94
- python.exe runTests.py test/unit/math/fwd -j2
95
- python.exe runTests.py test/unit/math/mix/core -j2
96
- python.exe runTests.py test/unit/math/mix/functor -j2
97
- python.exe runTests.py test/unit/math/mix/meta -j2
98
- python.exe runTests.py test/unit/math/mix/prob -j2
99
- python.exe runTests.py test/unit/math/mix/*_test.cpp -j2
100
-
101
- - name : Upload gtest_output xml
102
- uses : actions/upload-artifact@v4
103
- if : failure()
104
- with :
105
- name : gtest_outputs_xml
106
- path : ' **/*_test.xml'
107
-
108
- mix-fun-1 :
109
- name : mix/fun tests 1
110
- runs-on : windows-latest
111
-
112
- steps :
113
- - uses : actions/checkout@v4
114
- - uses : actions/setup-python@v5
115
- with :
116
- python-version : ' 3.x'
117
- - uses : r-lib/actions/setup-r@v2
118
46
with :
119
47
r-version : ' release'
120
48
rtools-version : ' 44'
@@ -124,19 +52,20 @@ jobs:
124
52
run : echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
125
53
126
54
- name : Build Math libs
127
- shell : powershell
55
+ shell : pwsh
128
56
run : |
57
+ Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n"
129
58
make -f make/standalone math-libs -j2
59
+
130
60
- name : Add TBB to PATH
131
- shell : powershell
61
+ if : runner.os == 'Windows'
62
+ shell : pwsh
132
63
run : echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
133
- - name : Run mix/fun unit tests
134
- shell : powershell
64
+
65
+ - name : Run ${{ matrix.config.label }} unit tests
66
+ shell : pwsh
135
67
run : |
136
- $MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
137
- $NumberTests = $MixFunTests.Length
138
- $HalfNumberTests = [math]::Floor($NumberTests / 2)
139
- python.exe runTests.py $MixFunTests[0..$HalfNumberTests]
68
+ python runTests.py -j4 ${{ matrix.config.tests }}
140
69
141
70
- name : Upload gtest_output xml
142
71
uses : actions/upload-artifact@v4
@@ -145,16 +74,23 @@ jobs:
145
74
name : gtest_outputs_xml
146
75
path : ' **/*_test.xml'
147
76
148
- mix-fun-2 :
149
- name : mix/fun tests 2
150
- runs-on : windows-latest
77
+ mix-fun :
78
+ name : mix fun and prob tests ${{ matrix.group }} (${{ matrix.os }})
79
+ runs-on : ${{ matrix.os }}
80
+ strategy :
81
+ fail-fast : false
82
+ matrix :
83
+ os : [windows-latest, ubuntu-24.04-arm]
84
+ group : [1, 2, 3, 4, 5]
151
85
152
86
steps :
153
87
- uses : actions/checkout@v4
154
88
- uses : actions/setup-python@v5
155
89
with :
156
90
python-version : ' 3.x'
91
+
157
92
- uses : r-lib/actions/setup-r@v2
93
+ if : runner.os == 'Windows'
158
94
with :
159
95
r-version : ' release'
160
96
rtools-version : ' 44'
@@ -164,20 +100,32 @@ jobs:
164
100
run : echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
165
101
166
102
- name : Build Math libs
167
- shell : powershell
103
+ shell : pwsh
168
104
run : |
169
- Add-Content make\local "O=1 `n"
105
+ Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation `n"
170
106
make -f make/standalone math-libs -j2
107
+
171
108
- name : Add TBB to PATH
172
- shell : powershell
109
+ if : runner.os == 'Windows'
110
+ shell : pwsh
173
111
run : echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
112
+
174
113
- name : Run mix/fun unit tests
175
- shell : powershell
114
+ shell : pwsh
176
115
run : |
177
- $MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
178
- $NumberTests = $MixFunTests.Length
179
- $HalfNumberTests = [math]::Floor($NumberTests / 2)
180
- python.exe runTests.py $MixFunTests[($HalfNumberTests + 1)..($NumberTests - 1)]
116
+ $MixFunProbTests = Get-ChildItem -Path test\unit\math\mix\fun\*, test\unit\math\mix\prob\* -Include *.cpp | Resolve-Path -Relative
117
+ $NumberTests = $MixFunProbTests.Length
118
+ $FifthNumberTests = [math]::Floor($NumberTests / 5)
119
+
120
+ $MixFunProbTestsArray = @( `
121
+ $MixFunProbTests[0..($FifthNumberTests - 1)], `
122
+ $MixFunProbTests[$FifthNumberTests..(2 * $FifthNumberTests - 1)], `
123
+ $MixFunProbTests[(2 * $FifthNumberTests)..(3 * $FifthNumberTests - 1)], `
124
+ $MixFunProbTests[(3 * $FifthNumberTests)..(4 * $FifthNumberTests - 1)], `
125
+ $MixFunProbTests[(4 * $FifthNumberTests)..($NumberTests - 1)] `
126
+ )
127
+
128
+ python runTests.py -j2 $MixFunProbTestsArray[(${{ matrix.group }} - 1)]
181
129
182
130
- name : Upload gtest_output xml
183
131
uses : actions/upload-artifact@v4
0 commit comments