Skip to content

Commit

Permalink
Split Windows CI (#119)
Browse files Browse the repository at this point in the history
* Try to split off Julia tests

* Try to split out R

* Try to split out Python

* Debug

* Revert debug

* Properly skip non-Windows test
  • Loading branch information
WardBrian authored May 8, 2023
1 parent e70d303 commit 32bd072
Showing 1 changed file with 33 additions and 82 deletions.
115 changes: 33 additions & 82 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
CACHE_VERSION: 0

jobs:
build_test_models:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
Expand Down Expand Up @@ -64,12 +64,12 @@ jobs:
mingw32-make.exe STAN_THREADS=true O=0 test_models -j2
shell: pwsh

test_python_client:
needs: [build_test_models]
python:
needs: [build]
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, "3.10"]
fail-fast: false
steps:
Expand Down Expand Up @@ -105,17 +105,24 @@ jobs:
- name: Run tests
run: |
export BRIDGESTAN=$(pwd)
cd python/
pytest -v
pytest -v --run-type=ad_hessian
pytest -v python/
env:
BRIDGESTAN: ${{ github.workspace }}

- name: Run tests (Unix-specific)
if: matrix.os != 'windows-latest'
run: |
pytest -v python/ --run-type=ad_hessian
env:
BRIDGESTAN: ${{ github.workspace }}

test_julia_client:
needs: [build_test_models]

julia:
needs: [build]
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
julia-version: ["1"]
include:
- julia-version: "1.6"
Expand All @@ -131,6 +138,7 @@ jobs:
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}

- name: Restore Stan
uses: actions/cache@v3
id: stan-cache
Expand All @@ -147,15 +155,16 @@ jobs:

- name: Run tests
run: |
export BRIDGESTAN=$(pwd)
julia --project=./julia -t 2 -e "using Pkg; Pkg.test()"
env:
BRIDGESTAN: ${{ github.workspace }}

test_R_client:
needs: [build_test_models]
Rlang:
needs: [build]
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
steps:
- name: Check out github
Expand Down Expand Up @@ -187,80 +196,22 @@ jobs:
path: ./test_models/
key: ${{ hashFiles('**/*.stan', 'src/*', 'stan/src/stan/version.hpp', 'Makefile') }}-${{ matrix.os }}-v${{ env.CACHE_VERSION }}

# needed for R tests until they have compilation utilities and can set this themselves.
- name: Set up TBB
if: matrix.os == 'windows-latest'
run: |
Add-Content $env:GITHUB_PATH "$(pwd)/stan/lib/stan_math/lib/tbb"
- name: Run tests
if: matrix.os != 'windows-latest'
run: |
cd R/tests/testthat
gcc -fpic -shared -o test_collisions.so test_collisions.c
cd ../..
Rscript -e "devtools::test(reporter = c(\"summary\", \"fail\"))"
# Seperate for now, weird dynamic linking issues need resolving in GHA runner
test_clients_windows:
needs: [build_test_models]
runs-on: windows-latest
steps:
- name: Check out github
uses: actions/checkout@v3
with:
submodules: recursive

- name: Restore Stan
uses: actions/cache@v3
id: stan-cache
with:
path: ./stan/
key: ${{ runner.os }}-stan-${{ hashFiles('stan/src/stan/version.hpp') }}-v${{ env.CACHE_VERSION }}


- name: Restore built models
uses: actions/cache@v3
id: test-models
with:
path: ./test_models/
key: ${{ hashFiles('**/*.stan', 'src/*', 'stan/src/stan/version.hpp', 'Makefile') }}-windows-latest-v${{ env.CACHE_VERSION }}

- name: Install R
uses: r-lib/actions/setup-r@v2.6.3

- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2.6.3
with:
packages: |
any::R6
any::testthat
any::devtools
- name: Set up Julia
uses: julia-actions/setup-julia@v1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install Python package
run: |
cd python/
pip install pytest
pip install .
- name: Run Python tests
run: |
$env:BRIDGESTAN = $(pwd)
cd python/
pytest -v
- name: Run Julia tests
run: |
$env:BRIDGESTAN = $(pwd)
julia --project=./julia -t 2 -e "using Pkg; Pkg.test()"
# needed for R tests until they have compilation utilities and can set this themselves.
- name: Set up TBB
run: |
Add-Content $env:GITHUB_PATH "$(pwd)/stan/lib/stan_math/lib/tbb"
- name: Run R tests
- name: Run tests (windows)
if: matrix.os == 'windows-latest'
run: |
cd R/tests/testthat
gcc -fpic -shared -o test_collisions.dll test_collisions.c
Expand Down

0 comments on commit 32bd072

Please sign in to comment.