Skip to content

Commit

Permalink
Multi-ver test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Jan 8, 2024
1 parent 18b7d96 commit d0cc094
Showing 1 changed file with 14 additions and 131 deletions.
145 changes: 14 additions & 131 deletions .github/workflows/rtools-make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ concurrency:
cancel-in-progress: true

jobs:
prim-rev:
name: prim and rev tests
rtools-build-check:
runs-on: windows-latest
name: R {{ matrix.config.r }} with Rtools {{ matrix.config.rtools }}

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: '4.3.2', rtools: '43', path: 'C:/rtools43/x86_64-w64-mingw32.static.posix/bin;C:/rtools43/usr/bin'}
- {os: windows-latest, r: '4.2.3', rtools: '42', path: 'C:/rtools42/x86_64-w64-mingw32.static.posix/bin;C:/rtools42/usr/bin'}
- {os: windows-latest, r: '4.1.3', rtools: '40', path: 'C:/rtools40/mingw64/bin;C:/rtools40/usr/bin'}

steps:
- uses: actions/checkout@v4
Expand All @@ -30,11 +38,11 @@ jobs:
python-version: '3.x'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 4.1.3
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools }}

- name: Set path for Rtools40
if: runner.os == 'Windows'
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Set path for Rtools${{ matrix.config.rtools }}
run: echo ${{ matrix.config.path }} | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Build Math libs
shell: powershell
Expand All @@ -59,128 +67,3 @@ jobs:
with:
name: gtest_outputs_xml
path: '**/*_test.xml'

fwd-non-fun-mix:
name: fwd tests and non-fun mix tests
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 4.1.3

- name: Set path for Rtools40
if: runner.os == 'Windows'
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Build Math libs
shell: powershell
run: |
Add-Content make\local "O=1`n"
make -f make/standalone math-libs -j2
- name: Add TBB to PATH
shell: powershell
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Disable running fwd/mix tests
shell: powershell
run: echo "CXXFLAGS+= -DSTAN_MATH_TESTS_REV_ONLY" | Out-File -Append -FilePath make/local -Encoding utf8
- name: Run fwd unit tests and all the mix tests except those in mix/fun
shell: powershell
run: |
python.exe runTests.py test/unit/math/fwd -j2
python.exe runTests.py test/unit/math/mix/core -j2
python.exe runTests.py test/unit/math/mix/functor -j2
python.exe runTests.py test/unit/math/mix/meta -j2
python.exe runTests.py test/unit/math/mix/prob -j2
python.exe runTests.py test/unit/math/mix/*_test.cpp -j2
- name: Upload gtest_output xml
uses: actions/upload-artifact@v4
if: failure()
with:
name: gtest_outputs_xml
path: '**/*_test.xml'

mix-fun-1:
name: mix/fun tests 1
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 4.1.3

- name: Set path for Rtools40
if: runner.os == 'Windows'
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Build Math libs
shell: powershell
run: |
Add-Content make\local "O=1`n"
make -f make/standalone math-libs -j2
- name: Add TBB to PATH
shell: powershell
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Run mix/fun unit tests
shell: powershell
run: |
$MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
$NumberTests = $MixFunTests.Length
$HalfNumberTests = [math]::Floor($NumberTests / 2)
python.exe runTests.py $MixFunTests[0..$HalfNumberTests]
- name: Upload gtest_output xml
uses: actions/upload-artifact@v4
if: failure()
with:
name: gtest_outputs_xml
path: '**/*_test.xml'

mix-fun-2:
name: mix/fun tests 2
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 4.1.3

- name: Set path for Rtools40
if: runner.os == 'Windows'
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Build Math libs
shell: powershell
run: |
Add-Content make\local "O=1`n"
make -f make/standalone math-libs -j2
- name: Add TBB to PATH
shell: powershell
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Run mix/fun unit tests
shell: powershell
run: |
$MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
$NumberTests = $MixFunTests.Length
$HalfNumberTests = [math]::Floor($NumberTests / 2)
python.exe runTests.py $MixFunTests[($HalfNumberTests + 1)..($NumberTests - 1)]
- name: Upload gtest_output xml
uses: actions/upload-artifact@v4
if: failure()
with:
name: gtest_outputs_xml
path: '**/*_test.xml'

0 comments on commit d0cc094

Please sign in to comment.