Skip to content

Commit b29bf41

Browse files
Merge pull request #111 from JuliaML/cl/downstream
add downstream tests
2 parents 381c86f + b33611e commit b29bf41

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/Downstream.yml

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

0 commit comments

Comments
 (0)