Skip to content

Commit 73775d7

Browse files
bump versions, update AD tests, update workflows (#166)
This fixes all the existing CompatHelper PRs Closes #160 Closes #161 Closes #163 Closes #164 And also updates the AD testing to use Mooncake (and removes the previously commented-out Tracker and Zygote tests). And also updates the test and format workflows to more closely match the rest of TuringLang. In particular: - uses [TuringLang/actions/Format](https://github.com/TuringLang/actions?tab=readme-ov-file#format) for workflow standardisation - tests on both Julia 1.10 and Julia 1.11 - removes the `arch=x64` matrix variable which is no longer appropriate for macOS-latest (should be `aarch64`, but leaving it out is easier as it will allow GitHub to automatically determine the right architecture) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 3cfac5c commit 73775d7

File tree

6 files changed

+49
-62
lines changed

6 files changed

+49
-62
lines changed

.github/workflows/CI.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,46 @@ on:
66
tags: ["*"]
77
pull_request:
88
workflow_dispatch:
9+
10+
# Cancel existing tests on the same PR if a new commit is added to a pull request
911
concurrency:
10-
# Skip intermediate builds: always.
11-
# Cancel intermediate builds: only if it is a pull request build.
12-
group: ${{ github.workflow }}-${{ github.ref }}
13-
cancel-in-progress: false
12+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
1415
jobs:
1516
test:
1617
name: Julia CI
1718
runs-on: ${{ matrix.os }}
1819
timeout-minutes: 90
19-
continue-on-error: ${{ matrix.version == 'nightly' }}
2020
strategy:
2121
fail-fast: false
2222
matrix:
2323
version:
24-
- '1.10'
24+
- 'lts'
25+
- '1'
2526
os:
2627
- ubuntu-latest
2728
- windows-latest
2829
- macOS-latest
29-
arch:
30-
- x64
3130
steps:
3231
- uses: actions/checkout@v4
3332
- uses: julia-actions/setup-julia@v2
3433
with:
3534
version: ${{ matrix.version }}
36-
arch: ${{ matrix.arch }}
3735
- uses: julia-actions/cache@v2
3836
- uses: julia-actions/julia-buildpkg@v1
3937
- uses: julia-actions/julia-runtest@v1
40-
with:
41-
coverage: "false"
4238
env:
4339
JULIA_NUM_THREADS: "auto"
40+
41+
- uses: julia-actions/julia-processcoverage@v1
42+
43+
- uses: codecov/codecov-action@v5
44+
with:
45+
files: lcov.info
46+
token: ${{ secrets.CODECOV_TOKEN }}
47+
48+
- uses: coverallsapp/github-action@v2
49+
with:
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
51+
path-to-lcov: lcov.info

.github/workflows/Format.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,19 @@ name: Format
33
on:
44
push:
55
branches:
6-
- "main"
7-
- "release-"
8-
tags: ["*"]
6+
- main
97
pull_request:
108

9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
1115
jobs:
1216
format:
13-
name: "Format Check"
1417
runs-on: ubuntu-latest
18+
1519
steps:
16-
- uses: actions/checkout@v4
17-
- uses: julia-actions/setup-julia@v2
18-
with:
19-
version: 1
20-
- name: Install JuliaFormatter and format
21-
run: |
22-
using Pkg
23-
Pkg.add(PackageSpec(name="JuliaFormatter"))
24-
using JuliaFormatter
25-
format("."; verbose=true)
26-
shell: julia --color=yes {0}
27-
- name: Suggest formatting changes
28-
uses: reviewdog/action-suggester@v1
29-
if: github.event_name == 'pull_request'
30-
with:
31-
tool_name: JuliaFormatter
32-
fail_on_error: true
20+
- name: Format code
21+
uses: TuringLang/actions/Format@main

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TuringGLM"
22
uuid = "0004c1f4-53c5-4d43-a221-a1dac6cf6b74"
33
authors = ["Jose Storopoli <[email protected]>", "Rik Huijzer <[email protected]>", "contributors"]
4-
version = "2.13.0"
4+
version = "2.14.0"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
@@ -29,5 +29,5 @@ StatsBase = "0.33 - 0.34"
2929
StatsModels = "0.6.28 - 0.7"
3030
TableOperations = "1.2"
3131
Tables = "1.6"
32-
Turing = "0.20 - 0.37"
32+
Turing = "0.20 - 0.39"
3333
julia = "1"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Build Status](https://github.com/TuringLang/TuringGLM.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/TuringLang/TuringGLM.jl/actions/workflows/CI.yml?query=branch%3Amain)
66
[![Coverage](https://codecov.io/gh/TuringLang/TuringGLM.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/TuringLang/TuringGLM.jl)
77
[![Coverage](https://coveralls.io/repos/github/TuringLang/TuringGLM.jl/badge.svg?branch=main)](https://coveralls.io/github/TuringLang/TuringGLM.jl?branch=main)
8-
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
8+
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/JuliaDiff/BlueStyle)
99
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
1010

1111
TuringGLM makes easy to specify Bayesian **G**eneralized **L**inear **M**odels using the formula syntax and returns an instantiated [Turing](https://github.com/TuringLang/Turing.jl) model.

test/Project.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@ CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
33
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
44
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
55
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
6+
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
67
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
78
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
89
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
910
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1011
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
11-
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
12-
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
1312

1413
[compat]
1514
CSV = "0.10"
1615
CategoricalArrays = "0.10"
1716
DataFrames = "1"
18-
ForwardDiff = "0.10"
17+
ForwardDiff = "0.10, 1"
18+
Mooncake = "0.4.122"
1919
ReverseDiff = "1"
2020
Statistics = "1"
2121
TimerOutputs = "0.5"
22-
Tracker = "0.2"
23-
Zygote = "0.6"

test/ad_backends.jl

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
1-
@timed_testset "ad_backends" begin
1+
using ForwardDiff: ForwardDiff
2+
using ReverseDiff: ReverseDiff
3+
using Mooncake: Mooncake
4+
5+
@timed_testset "ad_backends.jl" begin
26
DATA_DIR = joinpath("..", "data")
37
cheese = CSV.read(joinpath(DATA_DIR, "cheese.csv"), DataFrame)
48
f = @formula(y ~ (1 | cheese) + background)
59
m = turing_model(f, cheese)
6-
# only running 2 samples to test if the different ADs runs
7-
@timed_testset "ForwardDiff" begin
8-
chn = sample(m, NUTS(; adtype=AutoForwardDiff(; chunksize=8)), 2)
9-
@test chn isa Chains
10-
end
11-
# TODO: fix Tracker tests
12-
# @timed_testset "Tracker" begin
13-
# using Tracker
14-
# chn = sample(m, NUTS(; adtype=AutoTracker()), 2)
15-
# @test chn isa Chains
16-
# end
17-
# TODO: fix Zygote tests
18-
# @timed_testset "Zygote" begin
19-
# using Zygote
20-
# chn = sample(m, NUTS(; adtype=AutoZygote()), 2)
21-
# @test chn isa Chains
22-
# end
23-
@timed_testset "ReverseDiff" begin
24-
using ReverseDiff
25-
chn = sample(m, NUTS(; adtype=AutoReverseDiff(; compile=true)), 2)
26-
@test chn isa Chains
10+
11+
ADTYPES = [
12+
AutoForwardDiff(),
13+
AutoReverseDiff(; compile=false),
14+
AutoReverseDiff(; compile=true),
15+
AutoMooncake(; config=nothing),
16+
]
17+
@testset "$adtype" for adtype in ADTYPES
18+
@test sample(m, NUTS(; adtype=adtype), 20) isa Chains
2719
end
2820
end

0 commit comments

Comments
 (0)