Skip to content

Commit 1753362

Browse files
authored
Add action for performing downstream tests (#77)
* add downstream testing * don't run on draft PRs
1 parent 5a216bf commit 1753362

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/Downstream.yml

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

0 commit comments

Comments
 (0)