Skip to content

Commit 1ab2e4e

Browse files
committed
Add integration test (#217)
Fixes #215. The workflow is adapted from the setup in SciML and ChainRules. Test times could be reduced with a setup of the Turing tests similar to Bijectors (which was inspired by SciML) that allows to run a subset of tests based on an environment variable: https://github.com/TuringLang/Bijectors.jl/blob/ad6b01c4a214562ef845ab3b5a0a296b348e1ba9/test/runtests.jl#L29
1 parent 2b4c550 commit 1ab2e4e

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed

.github/workflows/IntegrationTest.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: IntegrationTest
2+
3+
on:
4+
push:
5+
branches:
6+
# This is where pull requests from "bors r+" are built.
7+
- staging
8+
# This is where pull requests from "bors try" are built.
9+
- trying
10+
# Build the master branch.
11+
- master
12+
13+
jobs:
14+
test:
15+
name: ${{ matrix.package.repo }}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
package:
21+
- {user: TuringLang, repo: Turing.jl}
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: julia-actions/setup-julia@v1
26+
with:
27+
version: 1
28+
arch: x64
29+
- uses: julia-actions/julia-buildpkg@latest
30+
- name: Clone Downstream
31+
uses: actions/checkout@v2
32+
with:
33+
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
34+
path: downstream
35+
- name: Load this and run the downstream tests
36+
shell: julia --color=yes --project=downstream {0}
37+
run: |
38+
using Pkg
39+
try
40+
# force it to use this PR's version of the package
41+
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
42+
Pkg.update()
43+
Pkg.test() # resolver may fail with test time deps
44+
catch err
45+
err isa Pkg.Resolve.ResolverError || rethrow()
46+
# If we can't resolve that means this is incompatible by SemVer and this is fine
47+
# It means we marked this as a breaking change, so we don't need to worry about
48+
# Mistakenly introducing a breaking change, as we have intentionally made one
49+
@info "Not compatible with this release. No problem." exception=err
50+
exit(0) # Exit immediately, as a success
51+
end

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# DynamicPPL.jl
22

3-
[![Build Status](https://github.com/TuringLang/DynamicPPL.jl/workflows/CI/badge.svg?branch=master)](https://github.com/TuringLang/DynamicPPL.jl/actions?query=workflow%3ACI+branch%3Amaster)
4-
[![Build Status](https://github.com/TuringLang/DynamicPPL.jl/workflows/JuliaNightly/badge.svg?branch=master)](https://github.com/TuringLang/DynamicPPL.jl/actions?query=workflow%3AJuliaNightly+branch%3Amaster)
3+
[![CI](https://github.com/TuringLang/DynamicPPL.jl/workflows/CI/badge.svg?branch=master)](https://github.com/TuringLang/DynamicPPL.jl/actions?query=workflow%3ACI+branch%3Amaster)
4+
[![JuliaNightly](https://github.com/TuringLang/DynamicPPL.jl/workflows/JuliaNightly/badge.svg?branch=master)](https://github.com/TuringLang/DynamicPPL.jl/actions?query=workflow%3AJuliaNightly+branch%3Amaster)
5+
[![IntegrationTest](https://github.com/TuringLang/DynamicPPL.jl/workflows/IntegrationTest/badge.svg?branch=master)](https://github.com/TuringLang/DynamicPPL.jl/actions?query=workflow%3AIntegrationTest+branch%3Amaster)
56
[![Coverage Status](https://coveralls.io/repos/github/TuringLang/DynamicPPL.jl/badge.svg?branch=master)](https://coveralls.io/github/TuringLang/DynamicPPL.jl?branch=master)
67
[![Codecov](https://codecov.io/gh/TuringLang/DynamicPPL.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/TuringLang/DynamicPPL.jl)
78
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://colprac.sciml.ai/)

bors.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ status = [
1414
"test (1.%, windows-latest, x64, 1)",
1515
"test (1.%, windows-latest, x64, 2)",
1616
"test (1, windows-latest, x64, 1)",
17-
"test (1, windows-latest, x64, 2)"
17+
"test (1, windows-latest, x64, 2)",
18+
"Turing.jl"
1819
]
1920
delete_merged_branches = true
2021
# Require at least on approval of a project member.

0 commit comments

Comments
 (0)