Skip to content

Commit 90791d5

Browse files
committed
fix tests and ci.yml
1 parent 1180d9c commit 90791d5

File tree

5 files changed

+38
-28
lines changed

5 files changed

+38
-28
lines changed

.github/workflows/CI.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,44 @@
11
name: CI
22
on:
3-
pull_request:
4-
branches:
5-
- master
6-
- dev
73
push:
84
branches:
9-
- master
105
- dev
11-
tags: '*'
6+
tags: ['*']
7+
pull_request:
8+
workflow_dispatch:
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1214
jobs:
1315
test:
14-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
16+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
1517
runs-on: ${{ matrix.os }}
18+
timeout-minutes: 60
19+
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
20+
actions: write
21+
contents: read
1622
strategy:
1723
fail-fast: false
1824
matrix:
1925
version:
20-
- '1.6'
2126
- '1'
27+
- 'lts'
2228
os:
2329
- ubuntu-latest
2430
arch:
2531
- x64
2632
steps:
27-
- uses: actions/checkout@v2
28-
- uses: julia-actions/setup-julia@v1
33+
- uses: actions/checkout@v4
34+
- uses: julia-actions/setup-julia@v2
2935
with:
3036
version: ${{ matrix.version }}
3137
arch: ${{ matrix.arch }}
32-
- uses: actions/cache@v1
33-
env:
34-
cache-name: cache-artifacts
35-
with:
36-
path: ~/.julia/artifacts
37-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
38-
restore-keys: |
39-
${{ runner.os }}-test-${{ env.cache-name }}-
40-
${{ runner.os }}-test-
41-
${{ runner.os }}-
38+
- uses: julia-actions/cache@v2
4239
- uses: julia-actions/julia-buildpkg@v1
4340
- uses: julia-actions/julia-runtest@v1
44-
env:
45-
JULIA_NUM_THREADS: '2'
4641
- uses: julia-actions/julia-processcoverage@v1
47-
- uses: codecov/codecov-action@v1
42+
- uses: codecov/codecov-action@v5
4843
with:
49-
file: lcov.info
44+
files: lcov.info

Project.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,18 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1212

1313
[compat]
1414
Distributions = "0.25"
15+
LinearAlgebra = "1.11"
16+
MLJBase = "1.7 - 1.8"
1517
MLJTuning = "0.8"
18+
Random = "1"
1619
julia = "1"
20+
21+
[extras]
22+
ComputationalResources = "ed09eef8-17a6-5b46-8889-db040fac31e3"
23+
EvoTrees = "f6006082-12f8-11e9-0c9c-0d5d367ab1e5"
24+
MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
25+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
26+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
27+
28+
[targets]
29+
test = ["ComputationalResources", "EvoTrees", "MLJ", "StableRNGs", "Test"]

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
using Distributed
2+
addprocs(2)
3+
14
@everywhere begin
25
using MLJParticleSwarmOptimization
36
using Random
@@ -6,7 +9,6 @@
69
using Distributions
710
using EvoTrees
811
using MLJ
9-
using MLJBase
1012
using MLJTuning
1113
using StableRNGs
1214
end

test/strategies/adaptive.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ for acceleration in modes
8282
@testset "EvoTree Tuning with AdaptiveParticleSwarm and $(typeof(acceleration))" begin
8383
rng = StableRNG(123)
8484
features = rand(rng, 10_000) .* 5 .- 2
85-
X = MLJBase.table(reshape(features, (size(features)[1], 1)))
85+
X = MLJ.table(reshape(features, (size(features)[1], 1)))
8686
y = sin.(features) .* 0.5 .+ 0.5
8787
y = EvoTrees.logit(y) + randn(rng, size(y))
8888
y = EvoTrees.sigmoid(y)
@@ -128,4 +128,4 @@ for acceleration in modes
128128
end
129129

130130
println("Adaptive PSO losses (see Issue #14):")
131-
(; modes=modes, losses=losses) |> MLJBase.pretty
131+
(; modes=modes, losses=losses) |> MLJ.pretty

test/strategies/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ for acceleration in (CPU1(), CPUProcesses(), CPUThreads())
1818
@testset "EvoTree Tuning with ParticleSwarm and $(typeof(acceleration))" begin
1919
rng = StableRNG(123)
2020
features = rand(rng, 10_000) .* 5 .- 2
21-
X = MLJBase.table(reshape(features, (size(features)[1], 1)))
21+
X = MLJ.table(reshape(features, (size(features)[1], 1)))
2222
y = sin.(features) .* 0.5 .+ 0.5
2323
y = EvoTrees.logit(y) + randn(rng, size(y))
2424
y = EvoTrees.sigmoid(y)

0 commit comments

Comments
 (0)