Skip to content

Commit 0f59711

Browse files
authored
Merge pull request #305 from TuringLang/sunxd/v0.10
v0.10
2 parents 99c01c3 + cbbd016 commit 0f59711

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+15400
-6806
lines changed

.JuliaFormatter.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
style="blue"
2+
always_use_return=false

.github/workflows/Benchmark.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
os: [ubuntu-latest, macOS-latest]
21+
os:
22+
- ubuntu-latest
23+
- macOS-latest
2224
include:
2325
- os: macOS-latest
2426
arch: aarch64

.github/workflows/Coverage.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
workflow_dispatch:
10+
11+
jobs:
12+
coverage:
13+
name: Code Coverage - Julia ${{ matrix.version }} on ${{ matrix.os }} (${{ matrix.arch }})
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
version:
18+
- '1'
19+
os:
20+
- ubuntu-latest
21+
arch:
22+
- x64
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: julia-actions/setup-julia@v2
28+
with:
29+
version: ${{ matrix.version }}
30+
arch: ${{ matrix.arch }}
31+
32+
- uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.julia
36+
~/.julia/artifacts
37+
key: ${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
38+
restore-keys: |
39+
${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}-
40+
${{ runner.os }}-julia-${{ matrix.version }}-
41+
42+
- uses: julia-actions/julia-buildpkg@v1
43+
44+
- name: Running all tests with coverage
45+
uses: julia-actions/julia-runtest@v1
46+
env:
47+
TEST_GROUP: "all"
48+
49+
- uses: julia-actions/julia-processcoverage@v1
50+
51+
- uses: codecov/codecov-action@v4
52+
with:
53+
file: lcov.info
54+
55+
- uses: coverallsapp/github-action@master
56+
with:
57+
github-token: ${{ secrets.GITHUB_TOKEN }}
58+
path-to-lcov: lcov.info

.github/workflows/Tests.yml

Lines changed: 95 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,31 @@ on:
1313
workflow_dispatch:
1414

1515
jobs:
16-
test:
17-
name: Julia ${{ matrix.version }} on ${{ matrix.os }} (${{ matrix.arch }})
16+
# Basic tests run in parallel
17+
test-basic:
18+
name: ${{ matrix.test_group }} - Julia ${{ matrix.version }} (${{ matrix.os }})
1819
runs-on: ${{ matrix.os }}
1920
continue-on-error: ${{ matrix.version == 'pre' }}
2021
strategy:
22+
fail-fast: false
2123
matrix:
2224
version:
2325
- '1'
24-
- 'min'
25-
- 'pre'
26+
# - 'min'
27+
# - 'pre'
2628
os:
2729
- ubuntu-latest
28-
- windows-latest
30+
# - windows-latest
2931
arch:
3032
- x64
31-
include:
32-
- version: 'min'
33-
os: ubuntu-latest
34-
arch: x64
35-
coverage: true
33+
test_group:
34+
- "elementary"
35+
- "frontend"
36+
- "graphs"
37+
- "compilation"
38+
- "log_density"
39+
- "model_operations"
40+
- "experimental"
3641

3742
steps:
3843
- uses: actions/checkout@v4
@@ -54,59 +59,97 @@ jobs:
5459
5560
- uses: julia-actions/julia-buildpkg@v1
5661

57-
- name: Running elementary tests
62+
- name: Running ${{ matrix.test_group }} tests
5863
uses: julia-actions/julia-runtest@v1
5964
env:
60-
TEST_GROUP: "elementary"
65+
TEST_GROUP: ${{ matrix.test_group }}
6166

62-
- name: Running compilation tests
63-
uses: julia-actions/julia-runtest@v1
64-
env:
65-
TEST_GROUP: "compilation"
66-
67-
- name: Running `log_density` tests
68-
uses: julia-actions/julia-runtest@v1
69-
env:
70-
TEST_GROUP: "log_density"
67+
# Slow inference tests with retry logic
68+
test-inference:
69+
name: ${{ matrix.test_group }} - Julia ${{ matrix.version }} (${{ matrix.os }})
70+
runs-on: ${{ matrix.os }}
71+
continue-on-error: false
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
version:
76+
- '1'
77+
os:
78+
- ubuntu-latest
79+
arch:
80+
- x64
81+
test_group:
82+
- "inference_hmc"
83+
- "inference_chains"
84+
- "inference_mh"
85+
- "gibbs"
7186

72-
- name: Running `source_gen` tests
73-
uses: julia-actions/julia-runtest@v1
74-
env:
75-
TEST_GROUP: "source_gen"
87+
steps:
88+
- uses: actions/checkout@v4
7689

77-
- name: Running `gibbs` tests
78-
uses: nick-fields/retry@v3
90+
- uses: julia-actions/setup-julia@v2
7991
with:
80-
timeout_minutes: 10
81-
max_attempts: 3
82-
command: julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.test(coverage=true);"
83-
env:
84-
TEST_GROUP: "gibbs"
85-
86-
- name: Running `mcmchains` tests
87-
uses: nick-fields/retry@v3
92+
version: ${{ matrix.version }}
93+
arch: ${{ matrix.arch }}
94+
95+
- uses: actions/cache@v4
8896
with:
89-
timeout_minutes: 10
90-
max_attempts: 3
91-
command: julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.test(coverage=true);"
92-
env:
93-
TEST_GROUP: "mcmchains"
97+
path: |
98+
~/.julia
99+
~/.julia/artifacts
100+
key: ${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
101+
restore-keys: |
102+
${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}-
103+
${{ runner.os }}-julia-${{ matrix.version }}-
104+
105+
- uses: julia-actions/julia-buildpkg@v1
94106

95-
- name: Running `experimental` tests
107+
- name: Running ${{ matrix.test_group }} tests
96108
uses: julia-actions/julia-runtest@v1
97109
env:
98-
TEST_GROUP: "experimental"
99-
100-
- uses: julia-actions/julia-processcoverage@v1
101-
if: matrix.coverage
110+
TEST_GROUP: ${{ matrix.test_group }}
102111

103-
- uses: codecov/codecov-action@v4
104-
if: matrix.coverage
112+
# Parallel sampling tests with multiple threads
113+
test-parallel:
114+
name: Parallel Sampling - Julia ${{ matrix.version }} (${{ matrix.os }})
115+
runs-on: ${{ matrix.os }}
116+
continue-on-error: false
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
version:
121+
- '1'
122+
os:
123+
- ubuntu-latest
124+
arch:
125+
- x64
126+
127+
steps:
128+
- uses: actions/checkout@v4
129+
130+
- uses: julia-actions/setup-julia@v2
105131
with:
106-
file: lcov.info
132+
version: ${{ matrix.version }}
133+
arch: ${{ matrix.arch }}
107134

108-
- uses: coverallsapp/github-action@master
109-
if: matrix.coverage
135+
- uses: actions/cache@v4
110136
with:
111-
github-token: ${{ secrets.GITHUB_TOKEN }}
112-
path-to-lcov: lcov.info
137+
path: |
138+
~/.julia
139+
~/.julia/artifacts
140+
key: ${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
141+
restore-keys: |
142+
${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}-
143+
${{ runner.os }}-julia-${{ matrix.version }}-
144+
145+
- uses: julia-actions/julia-buildpkg@v1
146+
147+
- name: Set thread count
148+
id: threads
149+
run: echo "count=$(nproc)" >> $GITHUB_OUTPUT
150+
151+
- name: Running parallel_sampling tests
152+
uses: julia-actions/julia-runtest@v1
153+
env:
154+
TEST_GROUP: parallel_sampling
155+
JULIA_NUM_THREADS: ${{ steps.threads.outputs.count }}

0 commit comments

Comments
 (0)