Skip to content

Commit 65f056c

Browse files
Update CI: No nightly tests, improve macOS CI setup + use julia-actions/cache (#1863)
* Test prereleases if available * Fix name? * Fix matrix * Fixes * Fix syntax * Another round of fixes * Remove prerelease CI * Better mac fix? * Fix typo * Fix failing tests on 1.11-beta (#1862) * Increase sample size when testing empirical moments of DiscreteNonParametric * Use StableRNGs for semicircle.jl to avoid breakage on 1.11-beta * Run CI on all PRs. Also CI for workflow_dispatch and merge_group * Update semicircle.jl Co-authored-by: David Widmann <devmotion@users.noreply.github.com> * Update locationscale.jl Co-authored-by: David Widmann <devmotion@users.noreply.github.com> * Update locationscale.jl Co-authored-by: David Widmann <devmotion@users.noreply.github.com> --------- Co-authored-by: David Widmann <devmotion@users.noreply.github.com> --------- Co-authored-by: Andreas Noack <andreas@noack.dk>
1 parent b356da0 commit 65f056c

File tree

3 files changed

+18
-32
lines changed

3 files changed

+18
-32
lines changed

.github/workflows/CI.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: CI
22

33
on:
44
pull_request:
5-
branches:
6-
- master
75
push:
86
branches:
97
- master
108
tags: '*'
9+
workflow_dispatch:
10+
merge_group:
1111

1212
concurrency:
1313
# Skip intermediate builds: always.
@@ -17,42 +17,27 @@ concurrency:
1717

1818
jobs:
1919
test:
20-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
20+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }}
2121
runs-on: ${{ matrix.os }}
22-
continue-on-error: ${{ matrix.version == 'nightly' }}
2322
strategy:
2423
fail-fast: false
2524
matrix:
2625
version:
2726
- '1.3'
2827
- '1'
29-
- 'nightly'
3028
os:
3129
- ubuntu-latest
3230
- macos-latest
3331
- windows-latest
34-
arch:
35-
- x64
36-
include:
37-
- os: macOS-14
38-
arch: aarch64
39-
version: '1'
4032
steps:
4133
- uses: actions/checkout@v4
4234
- uses: julia-actions/setup-julia@v2
4335
with:
4436
version: ${{ matrix.version }}
45-
arch: ${{ matrix.arch }}
46-
- uses: actions/cache@v4
47-
env:
48-
cache-name: cache-artifacts
49-
with:
50-
path: ~/.julia/artifacts
51-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
52-
restore-keys: |
53-
${{ runner.os }}-test-${{ env.cache-name }}-
54-
${{ runner.os }}-test-
55-
${{ runner.os }}-
37+
# ARM64 on macos-latest is neither supported by older Julia versions nor setup-julia
38+
arch: ${{ matrix.os == 'macos-latest' && matrix.version != '1.3' && 'aarch64' || 'x64' }}
39+
show-versioninfo: true
40+
- uses: julia-actions/cache@v1
5641
- uses: julia-actions/julia-buildpkg@v1
5742
- uses: julia-actions/julia-runtest@v1
5843
- run: |
@@ -74,6 +59,7 @@ jobs:
7459
- uses: julia-actions/setup-julia@v2
7560
with:
7661
version: '1'
62+
show-versioninfo: true
7763
- run: |
7864
julia --project=docs -e '
7965
using Pkg

test/univariate/continuous/semicircle.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Distributions
2-
using Random: MersenneTwister
2+
using StableRNGs
33
using Test
44

55
d = Semicircle(2.0)
@@ -39,8 +39,8 @@ d = Semicircle(2.0)
3939
@test quantile(d, .5) == .0
4040
@test quantile(d, 1.0) == +2.0
4141

42-
rng = MersenneTwister(0)
43-
for r in rand(rng, Uniform(0,10), 5)
42+
rng = StableRNG(123)
43+
@testset for r in rand(rng, Uniform(0,10), 5)
4444
N = 10^4
4545
semi = Semicircle(r)
4646
sample = rand(rng, semi, N)

test/univariate/locationscale.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function test_location_scale(
110110
@test invlogccdf(dtest, log(0.5)) invlogccdf(dref, log(0.5))
111111
@test invlogccdf(dtest, log(0.8)) invlogccdf(dref, log(0.8))
112112

113-
r = Array{float(eltype(dtest))}(undef, 100000)
113+
r = Array{float(eltype(dtest))}(undef, 200000)
114114
if ismissing(rng)
115115
rand!(dtest, r)
116116
else
@@ -148,19 +148,19 @@ end
148148
rng = MersenneTwister(123)
149149

150150
@testset "Normal" begin
151-
for _rng in (missing, rng), sign in (1, -1)
151+
@testset for _rng in (missing, rng), sign in (1, -1)
152152
test_location_scale_normal(_rng, 0.3, sign * 0.2, 0.1, 0.2)
153153
test_location_scale_normal(_rng, -0.3, sign * 0.1, -0.1, 0.3)
154154
test_location_scale_normal(_rng, 1.3, sign * 0.4, -0.1, 0.5)
155155
end
156156
test_location_scale_normal(rng, ForwardDiff.Dual(0.3), 0.2, 0.1, 0.2)
157157
end
158158
@testset "DiscreteNonParametric" begin
159-
probs = normalize!(rand(10), 1)
160-
for _rng in (missing, rng), sign in (1, -1)
161-
test_location_scale_discretenonparametric(_rng, 1//3, sign * 1//2, 1:10, probs)
162-
test_location_scale_discretenonparametric(_rng, -1//4, sign * 1//3, (-10):(-1), probs)
163-
test_location_scale_discretenonparametric(_rng, 6//5, sign * 3//2, 15:24, probs)
159+
_probs = normalize!(rand(10), 1)
160+
@testset for _rng in (missing, rng), sign in (1, -1)
161+
test_location_scale_discretenonparametric(_rng, 1//3, sign * 1//2, 1:10, _probs)
162+
test_location_scale_discretenonparametric(_rng, -1//4, sign * 1//3, (-10):(-1), _probs)
163+
test_location_scale_discretenonparametric(_rng, 6//5, sign * 3//2, 15:24, _probs)
164164
end
165165
end
166166

0 commit comments

Comments
 (0)