Skip to content

Commit

Permalink
Split tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsiqueira committed May 27, 2021
1 parent 02cb3a4 commit a43300a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 19 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,11 @@ jobs:
fail-fast: false
matrix:
version: ['1.3', '1']
adbackend: ["ForwardDiffAD", "ZygoteAD", "ReverseDiffAD"]
problem_type: ["NLP", "NLS"]
os: [ubuntu-latest, macOS-latest, windows-latest]
arch: [x64]
allow_failure: [false]
include:
- version: 'nightly'
os: ubuntu-latest
arch: x64
allow_failure: true
- version: 'nightly'
os: macOS-latest
arch: x64
allow_failure: true
- version: 'nightly'
os: windows-latest
arch: x64
allow_failure: true
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand All @@ -48,6 +37,9 @@ jobs:
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
ADBACKEND: matrix.adbackend
PROBLEMTYPE: matrix.problem_type
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion test/nlp/nlpmodelstest.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

@testset "AD backend - $(adbackend)" for adbackend in (:ForwardDiffAD, :ZygoteAD, :ReverseDiffAD)
@testset "AD backend - $(adbackend)" for adbackend in backends()
for problem in NLPModelsTest.nlp_problems
@testset "Checking NLPModelsTest tests on problem $problem" begin
nlp_ad = eval(Meta.parse(lowercase(problem) * "_autodiff"))()
Expand Down
2 changes: 1 addition & 1 deletion test/nls/nlpmodelstest.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@testset "AD backend - $(adbackend)" for adbackend in (:ForwardDiffAD, :ZygoteAD, :ReverseDiffAD)
@testset "AD backend - $(adbackend)" for adbackend in backends()
for problem in NLPModelsTest.nls_problems
@testset "Checking NLPModelsTest tests on problem $problem" begin
nls_ad = eval(Meta.parse(lowercase(problem) * "_autodiff"))()
Expand Down
31 changes: 27 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,30 @@ for problem in NLPModelsTest.nls_problems
include("nls/problems/$(lowercase(problem)).jl")
end

include("nlp/basic.jl")
include("nls/basic.jl")
include("nlp/nlpmodelstest.jl")
include("nls/nlpmodelstest.jl")
function backends()
x = get(ENV, "ADBACKEND", nothing)
if x === nothing
return (:ForwardDiffAD, :ZygoteAD, :ReverseDiffAD)
else
return [Symbol(x)]
end
end

if get(ENV, "CI", "false") == "true"
if get(ENV, "PROBLEMTYPE", nothing) == "NLP"
println("nlp")
println(backends())
# include("nlp/basic.jl")
# include("nlp/nlpmodelstest.jl")
else
println("nls")
println(backends())
# include("nls/basic.jl")
# include("nls/nlpmodelstest.jl")
end
else
include("nlp/basic.jl")
include("nls/basic.jl")
include("nlp/nlpmodelstest.jl")
include("nls/nlpmodelstest.jl")
end

0 comments on commit a43300a

Please sign in to comment.