Skip to content

Commit

Permalink
restore x86 testing - run downstream tests only on PRs (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg authored Nov 1, 2024
1 parent 2a304e6 commit e1beb9e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
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

0 comments on commit e1beb9e

Please sign in to comment.