Skip to content

Commit 4e5a359

Browse files
Merge pull request #330 from SciML/qqy/downstream_mtk
Add downstream CI for MTK
2 parents 343f87f + f5f205a commit 4e5a359

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/Downstream.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: IntegrationTest
2+
on:
3+
push:
4+
branches: [master]
5+
tags: [v*]
6+
pull_request:
7+
concurrency:
8+
# Skip intermediate builds: always.
9+
# Cancel intermediate builds: only if it is a pull request build.
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
12+
jobs:
13+
test:
14+
name: ${{ matrix.package.repo }}/${{ matrix.package.group }}/${{ matrix.julia-version }}
15+
runs-on: ${{ matrix.os }}
16+
env:
17+
GROUP: ${{ matrix.package.group }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
julia-version: [1]
22+
os: [ubuntu-latest]
23+
package:
24+
- {user: SciML, repo: ModelingToolkit.jl, group: All}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: julia-actions/setup-julia@v2
28+
with:
29+
version: ${{ matrix.julia-version }}
30+
arch: x64
31+
- name: "Install Dependencies"
32+
run: |
33+
import Pkg
34+
Pkg.Registry.update()
35+
# Install packages present in subdirectories
36+
dev_pks = Pkg.PackageSpec[]
37+
for path in ("lib/BoundaryValueDiffEqCore", "lib/BoundaryValueDiffEqMIRK", "lib/BoundaryValueDiffEqMIRKN", "lib/BoundaryValueDiffEqFIRK", "lib/BoundaryValueDiffEqShooting", "lib/BoundaryValueDiffEqAscher")
38+
push!(dev_pks, Pkg.PackageSpec(; path))
39+
end
40+
Pkg.develop(dev_pks)
41+
Pkg.instantiate()
42+
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0}
43+
- name: Clone Downstream
44+
uses: actions/checkout@v4
45+
with:
46+
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
47+
path: downstream
48+
- name: Load this and run the downstream tests
49+
shell: julia --color=yes --project=downstream {0}
50+
run: |
51+
using Pkg
52+
try
53+
# force it to use this PR's version of the package
54+
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
55+
Pkg.update()
56+
Pkg.test(coverage="user") # resolver may fail with test time deps
57+
catch err
58+
err isa Pkg.Resolve.ResolverError || rethrow()
59+
# If we can't resolve that means this is incompatible by SemVer and this is fine
60+
# It means we marked this as a breaking change, so we don't need to worry about
61+
# Mistakenly introducing a breaking change, as we have intentionally made one
62+
@info "Not compatible with this release. No problem." exception=err
63+
exit(0) # Exit immediately, as a success
64+
end
65+
- uses: julia-actions/julia-processcoverage@v1
66+
with:
67+
directories: src,ext
68+
- uses: codecov/codecov-action@v5
69+
with:
70+
file: lcov.info
71+
token: ${{ secrets.CODECOV_TOKEN }}
72+
fail_ci_if_error: false

0 commit comments

Comments
 (0)