Skip to content
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
20 changes: 11 additions & 9 deletions .ci/ci.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,26 @@ resolved by Julia's package manager according to the package's compat bounds.
function test_package(pkg::AbstractString)
envdir = joinpath(@__DIR__, "env-" * pkg)
_clean_env!(envdir)
t0 = time()

# Activate isolated env for this package
@info "[$(pkg)] Activating isolated environment" envdir=envdir timestamp=Dates.now()
Pkg.activate(envdir)

# Bring the target package into this environment in development mode
@info "[$(pkg)] Developing package from local path" timestamp=Dates.now()
Pkg.develop(PackageSpec(path = joinpath(@__DIR__, "..", "lib", pkg)))

# Resolve, build, and precompile before testing
# Resolve dependencies for this package.
# Avoid explicit build/precompile here because these phases can hang on some CI
# runners; `Pkg.test` will perform required build/precompile work as needed.
@info "[$(pkg)] Instantiating dependencies" timestamp=Dates.now()
ENV["JULIA_PKG_PRECOMPILE_AUTO"] = "0"
Pkg.instantiate()
Pkg.build()
try
Pkg.precompile()
catch err
@warn "Precompile failed; proceeding to tests" exception=(err, catch_backtrace())
end

@info "Running tests for $(pkg) (auto-resolved dependencies)" timestamp=Dates.now()
@info "[$(pkg)] Running tests" timestamp=Dates.now()
Pkg.test(pkg; coverage = true)
@info "[$(pkg)] Finished successfully" elapsed_seconds=round(time() - t0; digits=2) timestamp=Dates.now()
end

# Allow selection via environment variables for CI job splitting.
Expand All @@ -66,4 +68,4 @@ else
# Run both if not explicitly selected
test_package("PlasmoBenders")
test_package("PlasmoSchwarz")
end
end
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
benders:
name: PlasmoBenders
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
Expand All @@ -36,6 +37,7 @@ jobs:
schwarz:
name: PlasmoSchwarz
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
Expand All @@ -51,4 +53,4 @@ jobs:
env:
PKG: PlasmoSchwarz
JULIA_NUM_THREADS: 1
run: julia --color=yes .ci/ci.jl
run: julia --color=yes .ci/ci.jl
Loading