# How to test multiple dependency version ranges (\< v"1" and ≥ v"1") in GitHub CI?

**URL:** https://discourse.julialang.org/t/how-to-test-multiple-dependency-version-ranges-v-1-and-v-1-in-github-ci/135857
**Category:** General Usage
**Tags:** testing, pkg
**Created:** [February 26, 2026, 7:57am UTC](https://discourse.julialang.org/t/how-to-test-multiple-dependency-version-ranges-v-1-and-v-1-in-github-ci/135857 "2026-02-26T07:57:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![singularitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/singularitti/32/17678_2.png) [@singularitti](https://discourse.julialang.org/u/singularitti)
#### Post date: [February 26, 2026, 7:57am UTC](https://discourse.julialang.org/t/how-to-test-multiple-dependency-version-ranges-v-1-and-v-1-in-github-ci/135857/1 "2026-02-26T07:57:11Z")

</div>

I maintain a Julia package that supports multiple major versions of one of its dependencies. The dependency defines:

```julia
get_version()::VersionNumber

```

and my tests contain logic like:

```julia
if get_version() >= v"1"
    # test new behavior
else
    # test legacy behavior
end

```

My package supports both ranges, and my `Project.toml` has:

```toml
[compat]
DepPkg = "0.9, 1"

```

So I want CI to test both cases:

- one job using DepPkg `< v"1"` (e.g. latest 0.9.x)
- one job using DepPkg `≥ v"1"` (latest 1.x)

* * *

## Current CI setup

My current GitHub Actions CI only tests across Julia versions, OS, and architecture:

```yaml
strategy:
  fail-fast: false
  matrix:
    version:
      - '1.10'
      - '1.11'
      - '1.12'
      - '1.9'
      - 'nightly'
    os:
      - ubuntu-latest
      - macOS-latest
      - windows-latest
    arch:
      - x64
      - x86

```

and runs:

```yaml
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1

```

This only tests the dependency version resolved by normal Pkg resolution (usually the newest compatible version).

* * *

## What I want to achieve

I want CI to explicitly test both dependency version ranges:

- Job A: resolve DepPkg to `< v"1"`
- Job B: resolve DepPkg to `≥ v"1"`

while keeping my package compat as:

```toml
DepPkg = "0.9, 1"

```

* * *

## Questions

1. What is the recommended way to test multiple dependency version ranges in CI?

2. How does this interact with committed `Manifest.toml` files (if present)?

3. Is there an established best practice used by major Julia packages for testing across dependency major versions?

* * *

## Constraints / goals

- Keep normal `Project.toml` compat broad (`"0.9, 1"`)
- Avoid maintaining multiple test projects if possible
- Ensure CI reproducibly tests both code paths
- Use standard `julia-actions` where possible

* * *

## Related context

I understand that Pkg resolves only one version per environment, so I assume this requires separate CI jobs with different resolution constraints. I’m mainly looking for the cleanest and most idiomatic way to do this.

---

<div class="post-metadata">

### Author: ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)
#### Post date: [February 26, 2026, 9:32am UTC](https://discourse.julialang.org/t/how-to-test-multiple-dependency-version-ranges-v-1-and-v-1-in-github-ci/135857/2 "2026-02-26T09:32:08Z")

</div>

Here’s one example: [Onda.jl/.github/workflows/CI.yml at b8b7720549c35cb57ee587b30a1b610065304253 · beacon-biosignals/Onda.jl · GitHub](https://github.com/beacon-biosignals/Onda.jl/blob/b8b7720549c35cb57ee587b30a1b610065304253/.github/workflows/CI.yml#L39)

---

<div class="post-metadata">

### Author: ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)
#### Post date: [February 26, 2026, 9:46pm UTC](https://discourse.julialang.org/t/how-to-test-multiple-dependency-version-ranges-v-1-and-v-1-in-github-ci/135857/3 "2026-02-26T21:46:28Z")

</div>

Or more simply you could edit the compat entry just before running the tests in CI with `Pkg.compat("DepPkg", "0.9")`.
