Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Windows CI #119

Merged
merged 6 commits into from
May 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]

- name: Install R dependencies
uses: r-lib/actions/[email protected]
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