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
23
34on :
45 pull_request :
@@ -20,101 +21,28 @@ concurrency:
2021
2122jobs :
2223 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+ ]
2537
2638 steps :
2739 - uses : actions/checkout@v4
2840 - uses : actions/setup-python@v5
2941 with :
3042 python-version : ' 3.x'
31- - uses : r-lib/actions/setup-r@v2
32- with :
33- r-version : ' release'
34- rtools-version : ' 44'
3543
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'
7244 - uses : r-lib/actions/setup-r@v2
73- with :
74- r-version : ' release'
75- rtools-version : ' 44'
76-
77- - name : Set path for Rtools44
7845 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
11846 with :
11947 r-version : ' release'
12048 rtools-version : ' 44'
@@ -124,19 +52,20 @@ jobs:
12452 run : echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
12553
12654 - name : Build Math libs
127- shell : powershell
55+ shell : pwsh
12856 run : |
57+ Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n"
12958 make -f make/standalone math-libs -j2
59+
13060 - name : Add TBB to PATH
131- shell : powershell
61+ if : runner.os == 'Windows'
62+ shell : pwsh
13263 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
13567 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 }}
14069
14170 - name : Upload gtest_output xml
14271 uses : actions/upload-artifact@v4
@@ -145,16 +74,23 @@ jobs:
14574 name : gtest_outputs_xml
14675 path : ' **/*_test.xml'
14776
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]
15185
15286 steps :
15387 - uses : actions/checkout@v4
15488 - uses : actions/setup-python@v5
15589 with :
15690 python-version : ' 3.x'
91+
15792 - uses : r-lib/actions/setup-r@v2
93+ if : runner.os == 'Windows'
15894 with :
15995 r-version : ' release'
16096 rtools-version : ' 44'
@@ -164,20 +100,32 @@ jobs:
164100 run : echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
165101
166102 - name : Build Math libs
167- shell : powershell
103+ shell : pwsh
168104 run : |
169- Add-Content make\local "O=1 `n"
105+ Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation `n"
170106 make -f make/standalone math-libs -j2
107+
171108 - name : Add TBB to PATH
172- shell : powershell
109+ if : runner.os == 'Windows'
110+ shell : pwsh
173111 run : echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
112+
174113 - name : Run mix/fun unit tests
175- shell : powershell
114+ shell : pwsh
176115 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)]
181129
182130 - name : Upload gtest_output xml
183131 uses : actions/upload-artifact@v4
0 commit comments