Skip to content

Commit 5a36abf

Browse files
feat: add CI for testing against released package versions
1 parent c0a61ab commit 5a36abf

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/ReleaseTest.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: ReleaseTest
2+
on:
3+
push:
4+
branches: [master]
5+
tags: [v*]
6+
pull_request:
7+
paths-ignore:
8+
- 'docs/**'
9+
10+
concurrency:
11+
# Skip intermediate builds: always, but for the master branch and tags.
12+
# Cancel intermediate builds: always, but for the master branch and tags.
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.refs != 'refs/tags/*' }}
15+
16+
jobs:
17+
test:
18+
name: ${{ matrix.package.package }}/${{ matrix.package.group }}/${{ matrix.julia-version }}
19+
runs-on: ${{ matrix.os }}
20+
env:
21+
GROUP: ${{ matrix.package.group }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
julia-version: [1]
26+
os: [ubuntu-latest]
27+
package:
28+
- {package: Catalyst, group: All}
29+
steps:
30+
- uses: actions/checkout@v4
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: Load this and run the downstream tests
37+
shell: julia --color=yes --project=@. {0}
38+
run: |
39+
using Pkg
40+
try
41+
# force it to use this PR's version of the package
42+
Pkg.add("${{ matrix.package.package }}")
43+
Pkg.update()
44+
Pkg.test(coverage=true) # resolver may fail with test time deps
45+
catch err
46+
err isa Pkg.Resolve.ResolverError || rethrow()
47+
# If we can't resolve that means this is incompatible by SemVer and this is fine
48+
# It means we marked this as a breaking change, so we don't need to worry about
49+
# Mistakenly introducing a breaking change, as we have intentionally made one
50+
@info "Not compatible with this release. No problem." exception=err
51+
exit(0) # Exit immediately, as a success
52+
end
53+
- uses: julia-actions/julia-processcoverage@v1
54+
- uses: codecov/codecov-action@v5
55+
with:
56+
files: lcov.info
57+
token: ${{ secrets.CODECOV_TOKEN }}
58+
fail_ci_if_error: false

0 commit comments

Comments
 (0)