From 0027efeb2b36ff0105dead40b58f4998716b5a5a Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 30 Nov 2025 13:39:46 -0500 Subject: [PATCH 1/7] CI: Add a CI workflow that tests downstream packages --- .github/workflows/downstream_packages.yml | 73 +++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/downstream_packages.yml diff --git a/.github/workflows/downstream_packages.yml b/.github/workflows/downstream_packages.yml new file mode 100644 index 0000000..ae8eacc --- /dev/null +++ b/.github/workflows/downstream_packages.yml @@ -0,0 +1,73 @@ +# This is largely copied from: +# https://github.com/SciML/ModelingToolkit.jl/blob/master/.github/workflows/Downstream.yml +# License: MIT + +name: Downstream +on: + push: + branches: + - master + - release-* + tags: ["*"] + pull_request: +concurrency: + # Skip intermediate builds: all builds except for builds on the `master` or `release-*` branches + # Cancel intermediate builds: only pull request builds + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} +permissions: + contents: read +jobs: + downstream: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + julia-version: + - 'lts' + - '1' + os: + - ubuntu-latest + package: + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - uses: julia-actions/setup-julia@v2 + with: + version: ${{ matrix.julia-version }} + - uses: julia-actions/julia-buildpkg@latest + - name: Clone Downstream + uses: actions/checkout@v6 + with: + repository: ${{ matrix.package.user }}/${{ matrix.package.repo }} + path: downstream + - name: Load this and run the downstream tests + shell: julia --color=yes {0} + env: + GITHUB_TOKEN: ${{ (matrix.package.repo == 'Registrator.jl') && secrets.GITHUB_TOKEN || '' }} + PACKAGE_SUBDIR: ${{ matrix.package.subdir }} + run: | + import Pkg + using Pkg: PackageSpec + const subdir = strip(ENV["PACKAGE_SUBDIR"]) + @info "" subdir + if isempty(subdir) + Pkg.activate("downstream") + else + Pkg.activate("downstream/$subdir") + end + @info "" Base.active_project() + try + # force it to use this PR's version of the package + Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps + Pkg.update() + Pkg.test() # resolver may fail with test time deps + catch err + err isa Pkg.Resolve.ResolverError || rethrow() + # If we can't resolve that means this is incompatible by SemVer and this is fine + # It means we marked this as a breaking change, so we don't need to worry about + # Mistakenly introducing a breaking change, as we have intentionally made one + @info "Not compatible with this release. No problem." exception=err + exit(0) # Exit immediately, as a success + end From 4a38aacdbd5ffea31f892891c047cfea9b47b07f Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 30 Nov 2025 13:51:36 -0500 Subject: [PATCH 2/7] Add `JuliaRegistries/Registrator.jl` to the downstream package list --- .github/workflows/downstream_packages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/downstream_packages.yml b/.github/workflows/downstream_packages.yml index ae8eacc..6c2c246 100644 --- a/.github/workflows/downstream_packages.yml +++ b/.github/workflows/downstream_packages.yml @@ -29,6 +29,7 @@ jobs: os: - ubuntu-latest package: + - {user: JuliaRegistries, repo: Registrator.jl} steps: - uses: actions/checkout@v6 with: From 17063fcd1f54c2bcf2841f83730d49f0b318c914 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 30 Nov 2025 14:04:08 -0500 Subject: [PATCH 3/7] Add `JuliaRegistries/RegistryCI.jl` to the downstream packages list --- .github/workflows/downstream_packages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/downstream_packages.yml b/.github/workflows/downstream_packages.yml index 6c2c246..c23f7ea 100644 --- a/.github/workflows/downstream_packages.yml +++ b/.github/workflows/downstream_packages.yml @@ -30,6 +30,7 @@ jobs: - ubuntu-latest package: - {user: JuliaRegistries, repo: Registrator.jl} + - {user: JuliaRegistries, repo: RegistryCI.jl, subdir: RegistryCI} steps: - uses: actions/checkout@v6 with: @@ -48,6 +49,7 @@ jobs: env: GITHUB_TOKEN: ${{ (matrix.package.repo == 'Registrator.jl') && secrets.GITHUB_TOKEN || '' }} PACKAGE_SUBDIR: ${{ matrix.package.subdir }} + JULIA_PKG_UNPACK_REGISTRY: ${{ matrix.package.repo == 'RegistryCI.jl' }} # RegistryCI needs an unpacked registry run: | import Pkg using Pkg: PackageSpec From 9011e60abf6ed0d5d75a86312433f4d5a2546049 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 30 Nov 2025 14:33:29 -0500 Subject: [PATCH 4/7] Add `GunnarFarneback/LocalRegistry.jl` to the downstream package list --- .github/workflows/downstream_packages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/downstream_packages.yml b/.github/workflows/downstream_packages.yml index c23f7ea..137f531 100644 --- a/.github/workflows/downstream_packages.yml +++ b/.github/workflows/downstream_packages.yml @@ -31,6 +31,7 @@ jobs: package: - {user: JuliaRegistries, repo: Registrator.jl} - {user: JuliaRegistries, repo: RegistryCI.jl, subdir: RegistryCI} + - {user: GunnarFarneback, repo: LocalRegistry.jl} steps: - uses: actions/checkout@v6 with: From 420452f787684dd8d6ad022ad08060c5f86f57e3 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 30 Nov 2025 18:00:56 -0500 Subject: [PATCH 5/7] No need for `julia-buildpkg` --- .github/workflows/downstream_packages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/downstream_packages.yml b/.github/workflows/downstream_packages.yml index 137f531..8abc4ae 100644 --- a/.github/workflows/downstream_packages.yml +++ b/.github/workflows/downstream_packages.yml @@ -39,7 +39,6 @@ jobs: - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.julia-version }} - - uses: julia-actions/julia-buildpkg@latest - name: Clone Downstream uses: actions/checkout@v6 with: From 8a2257ada160502694fb0ddb68b50d3ed8ac2b89 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 30 Nov 2025 18:01:46 -0500 Subject: [PATCH 6/7] Remove an unnecessary `if`-`else` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It should be fine to `Pkg.activate()` with a trailing slash. Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com> --- .github/workflows/downstream_packages.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/downstream_packages.yml b/.github/workflows/downstream_packages.yml index 8abc4ae..0ecbdc9 100644 --- a/.github/workflows/downstream_packages.yml +++ b/.github/workflows/downstream_packages.yml @@ -55,11 +55,7 @@ jobs: using Pkg: PackageSpec const subdir = strip(ENV["PACKAGE_SUBDIR"]) @info "" subdir - if isempty(subdir) - Pkg.activate("downstream") - else - Pkg.activate("downstream/$subdir") - end + Pkg.activate("downstream/$subdir") @info "" Base.active_project() try # force it to use this PR's version of the package From e716043249ac08b3917490b14d97002a7b5f6c4d Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 30 Nov 2025 18:02:53 -0500 Subject: [PATCH 7/7] Add some vertical spacing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com> --- .github/workflows/downstream_packages.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/downstream_packages.yml b/.github/workflows/downstream_packages.yml index 0ecbdc9..a8c9d2e 100644 --- a/.github/workflows/downstream_packages.yml +++ b/.github/workflows/downstream_packages.yml @@ -3,6 +3,7 @@ # License: MIT name: Downstream + on: push: branches: @@ -10,13 +11,16 @@ on: - release-* tags: ["*"] pull_request: + concurrency: # Skip intermediate builds: all builds except for builds on the `master` or `release-*` branches # Cancel intermediate builds: only pull request builds group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + permissions: contents: read + jobs: downstream: runs-on: ${{ matrix.os }}