-
-
Notifications
You must be signed in to change notification settings - Fork 203
141 lines (122 loc) · 5.17 KB
/
main.yml
File metadata and controls
141 lines (122 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Note that the workflows below use Powershell (pwsh) as they were originally written for Windows runners.
name: Rtools & ARM64 CI
on:
pull_request:
branches: [ develop, master ]
push:
branches: [ develop ]
paths-ignore:
- 'doygen/**'
- 'hooks/**'
- 'licenses/**'
- 'LICENSE.md'
- 'README.md'
- 'RELEASE-NOTES.txt'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
prim-rev:
name: ${{ matrix.config.label }} tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-11-arm, windows-latest, ubuntu-24.04-arm]
config: [
{ label: misc, tests: 'test/unit/*_test.cpp test/unit/math/*_test.cpp test/unit/math/memory' },
{ label: prim, tests: 'test/unit/math/prim' },
{ label: rev, tests: 'test/unit/math/rev' },
{ label: fwd, tests: 'test/unit/math/fwd' },
{ label: 'non-fun mix', tests: 'test/unit/math/mix/core test/unit/math/mix/meta test/unit/math/mix/*_test.cpp' }
]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Download and Install Rtools45
if: runner.os == 'Windows'
run: |
$ARCH = if ('${{ matrix.os }}' -eq 'windows-11-arm') { 'aarch64' } else { 'x86_64' }
$RTOOLS = if ('${{ matrix.os }}' -eq 'windows-11-arm') { "rtools45-$ARCH" } else { 'rtools45' }
# Installation will hang if the toolchain is already installed
if (-Not $(Test-Path -Path "C:/$RTOOLS")) {
Invoke-WebRequest `
-Uri https://github.com/r-hub/rtools45/releases/download/latest/$RTOOLS.exe `
-OutFile "$RTOOLS.exe"
Start-Process -FilePath "$RTOOLS.exe" -ArgumentList "/INSTALL /VERYSILENT /SUPPRESSMSGBOXES" -Wait
}
echo "C:/$RTOOLS/usr/bin;C:/$RTOOLS/$ARCH-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
echo "$(pwd)/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Build Math libs
shell: pwsh
run: |
Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n"
Add-Content make\local "STAN_THREADS=true`n"
make -f make/standalone math-libs -j2
- name: Run ${{ matrix.config.label }} unit tests
shell: pwsh
run: |
python runTests.py -j4 ${{ matrix.config.tests }}
- name: Upload gtest_output xml
uses: actions/upload-artifact@v7
if: failure()
with:
name: gtest_outputs_xml
path: '**/*_test.xml'
mix-fun:
name: mix fun and prob tests ${{ matrix.group }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-11-arm, windows-latest, ubuntu-24.04-arm]
group: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Download and Install Rtools45
if: runner.os == 'Windows'
run: |
$ARCH = if ('${{ matrix.os }}' -eq 'windows-11-arm') { 'aarch64' } else { 'x86_64' }
$RTOOLS = if ('${{ matrix.os }}' -eq 'windows-11-arm') { "rtools45-$ARCH" } else { 'rtools45' }
# Installation will hang if the toolchain is already installed
if (-Not $(Test-Path -Path "C:/$RTOOLS")) {
Invoke-WebRequest `
-Uri https://github.com/r-hub/rtools45/releases/download/latest/$RTOOLS.exe `
-OutFile "$RTOOLS.exe"
Start-Process -FilePath "$RTOOLS.exe" -ArgumentList "/INSTALL /VERYSILENT /SUPPRESSMSGBOXES" -Wait
}
echo "C:/$RTOOLS/usr/bin;C:/$RTOOLS/$ARCH-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
echo "$(pwd)/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Build Math libs
shell: pwsh
run: |
Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n"
Add-Content make\local "STAN_THREADS=true`n"
make -f make/standalone math-libs -j2
- name: Run mix/fun unit tests
shell: pwsh
run: |
$MixFunProbTests = Get-ChildItem -Path test\unit\math\mix\fun\*, test\unit\math\mix\prob\* -Include *.cpp | Resolve-Path -Relative
$NumberTests = $MixFunProbTests.Length
$FifthNumberTests = [math]::Floor($NumberTests / 5)
$MixFunProbTestsArray = @( `
$MixFunProbTests[0..($FifthNumberTests - 1)], `
$MixFunProbTests[$FifthNumberTests..(2 * $FifthNumberTests - 1)], `
$MixFunProbTests[(2 * $FifthNumberTests)..(3 * $FifthNumberTests - 1)], `
$MixFunProbTests[(3 * $FifthNumberTests)..(4 * $FifthNumberTests - 1)], `
$MixFunProbTests[(4 * $FifthNumberTests)..($NumberTests - 1)] `
)
python runTests.py -j2 $MixFunProbTestsArray[(${{ matrix.group }} - 1)]
- name: Upload gtest_output xml
uses: actions/upload-artifact@v7
if: failure()
with:
name: gtest_outputs_xml
path: '**/*_test.xml'