This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
ci: test stan models #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Models | |
on: | |
push: | |
branches: | |
- master | |
- main | |
pull_request: | |
branches: | |
- master | |
- main | |
jobs: | |
test-turing: | |
name: Test Turing Models | |
runs-on: ubuntu-latest | |
env: | |
JULIA_NUM_THREADS: "auto" | |
strategy: | |
matrix: | |
jl-file: [ | |
"01-predictive_checks.jl", | |
"02-linear_regression-kidiq.jl", | |
"03-logistic_regression-wells.jl", | |
"04-ordinal_regression-esoph.jl", | |
"05-poisson_regression-roaches.jl", | |
"06-robust_linear_regression-duncan.jl", | |
"07-robust_beta_binomial_regression-wells.jl", | |
#"08-robust_robit_regression-wells.jl", # FIXME: broken | |
"09-robust_negative_binomial_regression-roaches.jl", | |
"10-robust_zero_inflated_regression-negative_binomial-roaches.jl", | |
"10-robust_zero_inflated_regression-poisson-roaches.jl", | |
"11-hierarchical_varying_intercept-cheese.jl", | |
"11-hierarchical_varying_intercept-non_centered-cheese.jl", | |
"12-hierarchical_varying_intercept_slope-cheese.jl", | |
"13-model_comparison-roaches.jl", | |
] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: "1" | |
- uses: julia-actions/cache@v1 | |
- name: Test ${{ matrix.jl-file }} | |
run: | | |
julia --project=turing -e 'using Pkg; Pkg.instantiate()' | |
julia --project=turing turing/${{ matrix.jl-file }} | |
test-stan: | |
name: Test Stan Models | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
stan: | |
[ | |
{ model: "01-predictive_checks-posterior", data: "/dev/null" }, | |
{ model: "01-predictive_checks-prior", data: "/dev/null" }, | |
{ model: "02-linear_regression-QR", data: "stan/kidiq.data.json" }, | |
{ | |
model: "02-linear_regression-optimized", | |
data: "stan/kidiq.data.json", | |
}, | |
{ model: "02-linear_regression", data: "stan/kidiq.data.json" }, | |
{ | |
model: "03-logistic_regression-optimized", | |
data: "stan/wells.data.json", | |
}, | |
{ model: "03-logistic_regression", data: "stan/wells.data.json" }, | |
{ | |
model: "04-ordinal_regression-optimized", | |
data: "stan/esoph.data.json", | |
}, | |
{ model: "04-ordinal_regression", data: "stan/esoph.data.json" }, | |
{ | |
model: "05-poisson_regression-optimized", | |
data: "stan/roaches.data.json", | |
}, | |
{ model: "05-poisson_regression", data: "stan/roaches.data.json" }, | |
{ | |
model: "06-robust_linear_regression", | |
data: "stan/kidiq.data.json", | |
}, | |
{ | |
model: "07-robust_beta_binomial_regression", | |
data: "stan/wells.data.json", | |
}, | |
{ | |
model: "08-robust_robit_regression", | |
data: "stan/wells.data.json", | |
}, | |
{ | |
model: "09-robust_negative_binomial_regression-optimized", | |
data: "stan/roaches.data.json", | |
}, | |
{ | |
model: "09-robust_negative_binomial_regression", | |
data: "stan/roaches.data.json", | |
}, | |
{ | |
model: "10-robust_zero_inflated_regression-negative_binomial-optimized", | |
data: "stan/roaches.data.json", | |
}, | |
{ | |
model: "10-robust_zero_inflated_regression-negative_binomial", | |
data: "stan/roaches.data.json", | |
}, | |
{ | |
model: "10-robust_zero_inflated_regression-poisson-optimized", | |
data: "stan/roaches.data.json", | |
}, | |
{ | |
model: "10-robust_zero_inflated_regression-poisson", | |
data: "stan/roaches.data.json", | |
}, | |
{ | |
model: "11-hierarchical_varying_intercept-non_centered", | |
data: "stan/cheese.data.json", | |
}, | |
{ | |
model: "11-hierarchical_varying_intercept", | |
data: "stan/cheese.data.json", | |
}, | |
{ | |
model: "12-hierarchical_varying_intercept_slope", | |
data: "stan/cheese.data.json", | |
}, | |
{ | |
model: "13-model_comparison-negative_binomial", | |
data: "stan/roaches.data.json", | |
}, | |
{ | |
model: "13-model_comparison-poisson", | |
data: "stan/roaches.data.json", | |
}, | |
{ | |
model: "13-model_comparison-zero_inflated-negative_binomial", | |
data: "stan/roaches.data.json", | |
}, | |
{ | |
model: "13-model_comparison-zero_inflated-poisson", | |
data: "stan/roaches.data.json", | |
}, | |
] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@v8 | |
- name: Cache Nix artifacts | |
uses: DeterminateSystems/magic-nix-cache-action@v2 | |
- name: Test ${{ matrix.stan.model }} | |
if: ${{ matrix.stan.data }} | |
run: | | |
echo "Compiling: ${{ matrix.stan.model }}" | |
nix develop -L . --command bash -c "stan stan/${{ matrix.stan.model }}" | |
nix develop -L . --command bash -c "stan/${{ matrix.stan.model }} sample data file=${{ matrix.stan.data }}" |