Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not run downstream test on main branch #173

Merged
merged 8 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ jobs:
- os: macos-latest
version: '1.6'
include:
- version: 'nightly'
os: ubuntu-latest
- os: ubuntu-latest
version: 'nightly'
arch: x64
experimental: true

steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
Expand Down
20 changes: 18 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ warn_ticks = :warn, "No strict ticks found"
const C = RGBA{Float64}
const C0 = RGBA{PlotUtils.Colors.N0f8}

bool_env(x, default::String = "0")::Bool = tryparse(Bool, get(ENV, x, default))

is_ci() = bool_env("CI")
is_64b() = Sys.WORD_SIZE == 64

@testset "colors" begin
@test plot_color(nothing) == C(0, 0, 0, 0)
@test plot_color(false) == C(0, 0, 0, 0)
Expand Down Expand Up @@ -120,7 +125,8 @@ end
@test optimize_ticks(-1, 2) == ([-1.0, 0.0, 1.0, 2.0], -1.0, 2.0)

# check if ticks still generate if max - min << abs(min) (i.e. for Float64 ranges)
@test optimize_ticks(1e11 - 1, 1e11 + 2) == (1e11 .+ (-1:2), 1e11 - 1.0, 1e11 + 2.0)
is_64b() &&
@test optimize_ticks(1e11 - 1, 1e11 + 2) == (1e11 .+ (-1:2), 1e11 - 1.0, 1e11 + 2.0)

@testset "dates" begin
dt1, dt2 = Dates.value(DateTime(2000)), Dates.value(DateTime(2100))
Expand Down Expand Up @@ -158,6 +164,7 @@ end

@testset "digits" begin
@testset "digits $((10^n) - 1)*10^$i" for n ∈ 1:9, i ∈ -9:9
(!is_64b() && n ≥ 9) && continue
y0 = 10^n
x0 = y0 - 1
x, y = (x0, y0) .* 10.0^i
Expand Down Expand Up @@ -314,7 +321,16 @@ end
@test stats.time < 1e-3 # ~ 0.22ms (on 1.9)
end

if Sys.islinux() && VERSION ≥ v"1.9.0" && isempty(VERSION.prerelease) # avoid running on `nightly`
if (
Sys.islinux() &&
VERSION ≥ v"1.11.0" &&
isempty(VERSION.prerelease) && # avoid running on `nightly`
is_64b() &&
(
!is_ci() ||
(is_ci() && get(ENV, "GITHUB_EVENT_NAME", "pull_request") == "pull_request")
)
)
@testset "downstream" begin
include("downstream.jl")
end
Expand Down
Loading