Skip to content

Commit d51d38c

Browse files
committed
Simplify file and expand parallelism
1 parent 9521ef2 commit d51d38c

1 file changed

Lines changed: 29 additions & 122 deletions

File tree

.github/workflows/main.yml

Lines changed: 29 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Windows Rtools44
1+
name: Rtools & ARM64 CI
22

33
on:
44
pull_request:
55
branches: [ develop, master ]
66
push:
7-
branches: [ arm64-test ]
7+
branches: [ develop ]
88
paths-ignore:
99
- 'doygen/**'
1010
- 'hooks/**'
@@ -20,13 +20,21 @@ concurrency:
2020

2121
jobs:
2222
prim-rev:
23-
name: prim and rev tests (${{ matrix.config.os }})
23+
name: (${{ matrix.config.label }}) tests (${{ matrix.config.os }})
2424
runs-on: ${{ matrix.config.os }}
2525
strategy:
2626
matrix:
2727
config:
28-
- { os: windows-latest }
29-
- { os: ubuntu-24.04-arm }
28+
- { os: windows-latest, label: misc, tests: 'test/unit/*_test.cpp test/unit/math/*_test.cpp test/unit/math/memory' }
29+
- { os: ubuntu-24.04-arm, label: misc, tests: 'test/unit/*_test.cpp test/unit/math/*_test.cpp test/unit/math/memory' }
30+
- { os: windows-latest, label: prim, tests: 'test/unit/math/prim' }
31+
- { os: ubuntu-24.04-arm, label: prim, tests: 'test/unit/math/prim' }
32+
- { os: windows-latest, label: rev, tests: 'test/unit/math/rev' }
33+
- { os: ubuntu-24.04-arm, label: rev, tests: 'test/unit/math/rev' }
34+
- { os: windows-latest, label: fwd, tests: 'test/unit/math/fwd' }
35+
- { os: ubuntu-24.04-arm, label: fwd, tests: 'test/unit/math/fwd' }
36+
- { os: windows-latest, label: 'non-fun mix', tests: 'test/unit/math/mix/core test/unit/math/mix/meta test/unit/math/mix/prob test/unit/math/mix/*_test.cpp' }
37+
- { os: ubuntu-24.04-arm, label: 'non-fun mix', tests: 'test/unit/math/mix/core test/unit/math/mix/meta test/unit/math/mix/prob test/unit/math/mix/*_test.cpp' }
3038

3139
steps:
3240
- uses: actions/checkout@v4
@@ -58,11 +66,7 @@ jobs:
5866
- name: Run prim and rev unit tests
5967
shell: pwsh
6068
run: |
61-
python runTests.py -j4 test/unit/*_test.cpp `
62-
test/unit/math/*_test.cpp `
63-
test/unit/math/prim `
64-
test/unit/math/rev `
65-
test/unit/math/memory
69+
python runTests.py -j4 ${{ matrix.config.tests }}
6670
6771
- name: Upload gtest_output xml
6872
uses: actions/upload-artifact@v4
@@ -71,71 +75,18 @@ jobs:
7175
name: gtest_outputs_xml
7276
path: '**/*_test.xml'
7377

74-
fwd-non-fun-mix:
75-
name: fwd tests and non-fun mix tests (${{ matrix.config.os }})
78+
mix-fun:
79+
name: mix/fun tests ${{ matrix.config.group }} (${{ matrix.config.os }})
7680
runs-on: ${{ matrix.config.os }}
7781
strategy:
7882
matrix:
7983
config:
80-
- { os: windows-latest }
81-
- { os: ubuntu-24.04-arm }
82-
83-
steps:
84-
- uses: actions/checkout@v4
85-
- uses: actions/setup-python@v5
86-
with:
87-
python-version: '3.x'
88-
89-
- uses: r-lib/actions/setup-r@v2
90-
if: runner.os == 'Windows'
91-
with:
92-
r-version: 'release'
93-
rtools-version: '44'
94-
95-
- name: Set path for Rtools44
96-
if: runner.os == 'Windows'
97-
run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
98-
99-
- name: Build Math libs
100-
shell: pwsh
101-
run: |
102-
Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n"
103-
make -f make/standalone math-libs -j2
104-
105-
- name: Add TBB to PATH
106-
if: runner.os == 'Windows'
107-
shell: pwsh
108-
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
109-
110-
- name: Disable running fwd/mix tests
111-
shell: pwsh
112-
run: echo "CXXFLAGS+= -DSTAN_MATH_TESTS_REV_ONLY" | Out-File -Append -FilePath make/local -Encoding utf8
113-
114-
- name: Run fwd unit tests and all the mix tests except those in mix/fun
115-
shell: pwsh
116-
run: |
117-
python runTests.py -j4 test/unit/math/fwd `
118-
test/unit/math/mix/core `
119-
test/unit/math/mix/functor `
120-
test/unit/math/mix/meta `
121-
test/unit/math/mix/prob `
122-
test/unit/math/mix/*_test.cpp
123-
124-
- name: Upload gtest_output xml
125-
uses: actions/upload-artifact@v4
126-
if: failure()
127-
with:
128-
name: gtest_outputs_xml
129-
path: '**/*_test.xml'
130-
131-
mix-fun-1:
132-
name: mix/fun tests 1 (${{ matrix.config.os }})
133-
runs-on: ${{ matrix.config.os }}
134-
strategy:
135-
matrix:
136-
config:
137-
- { os: windows-latest }
138-
- { os: ubuntu-24.04-arm }
84+
- { os: windows-latest, group: 1 }
85+
- { os: ubuntu-24.04-arm, group: 1 }
86+
- { os: windows-latest, group: 2 }
87+
- { os: ubuntu-24.04-arm, group: 2 }
88+
- { os: windows-latest, group: 3 }
89+
- { os: ubuntu-24.04-arm, group: 3 }
13990

14091
steps:
14192
- uses: actions/checkout@v4
@@ -169,59 +120,15 @@ jobs:
169120
run: |
170121
$MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
171122
$NumberTests = $MixFunTests.Length
172-
$HalfNumberTests = [math]::Floor($NumberTests / 2)
173-
python runTests.py -j2 $MixFunTests[0..$HalfNumberTests]
123+
$ThirdNumberTests = [math]::Floor($NumberTests / 3)
124+
$TwoThirdNumberTests = [math]::Floor(2 * $NumberTests / 3)
174125
175-
- name: Upload gtest_output xml
176-
uses: actions/upload-artifact@v4
177-
if: failure()
178-
with:
179-
name: gtest_outputs_xml
180-
path: '**/*_test.xml'
181-
182-
mix-fun-2:
183-
name: mix/fun tests 2 (${{ matrix.config.os }})
184-
runs-on: ${{ matrix.config.os }}
185-
strategy:
186-
matrix:
187-
config:
188-
- { os: windows-latest }
189-
- { os: ubuntu-24.04-arm }
126+
$MixFunTests1 = $MixFunTests[0..($ThirdNumberTests - 1)]
127+
$MixFunTests2 = $MixFunTests[$ThirdNumberTests..($TwoThirdNumberTests - 1)]
128+
$MixFunTests3 = $MixFunTests[$TwoThirdNumberTests..($NumberTests - 1)]
129+
$MixFunTestsArray = @($MixFunTests1, $MixFunTests2, $MixFunTests3)
190130
191-
steps:
192-
- uses: actions/checkout@v4
193-
- uses: actions/setup-python@v5
194-
with:
195-
python-version: '3.x'
196-
197-
- uses: r-lib/actions/setup-r@v2
198-
if: runner.os == 'Windows'
199-
with:
200-
r-version: 'release'
201-
rtools-version: '44'
202-
203-
- name: Set path for Rtools44
204-
if: runner.os == 'Windows'
205-
run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
206-
207-
- name: Build Math libs
208-
shell: pwsh
209-
run: |
210-
Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n"
211-
make -f make/standalone math-libs -j2
212-
213-
- name: Add TBB to PATH
214-
if: runner.os == 'Windows'
215-
shell: pwsh
216-
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
217-
218-
- name: Run mix/fun unit tests
219-
shell: pwsh
220-
run: |
221-
$MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
222-
$NumberTests = $MixFunTests.Length
223-
$HalfNumberTests = [math]::Floor($NumberTests / 2)
224-
python runTests.py -j2 $MixFunTests[($HalfNumberTests + 1)..($NumberTests - 1)]
131+
python runTests.py -j2 $MixFunTestsArray[(${{ matrix.config.group }} - 1)]
225132
226133
- name: Upload gtest_output xml
227134
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)