Skip to content

Commit

Permalink
Try installing packages only if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Jun 6, 2024
1 parent 5bc20fd commit 520266e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 2 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,15 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
LuxAMDGPU = "83120cb1-ca15-4f04-bf3b-6967d2e6b60b"
LuxCUDA = "d0bbae9a-e099-4d5b-a835-1c6931763bda"
LuxCore = "bb33d45b-7691-41d6-9220-0943567d0623"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestSetExtensions = "98d24dd4-01ad-11ea-1b02-c9a08f80db04"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b"

[targets]
test = ["Aqua", "ComponentArrays", "ExplicitImports", "FillArrays", "LuxAMDGPU", "LuxCUDA", "LuxCore", "Metal", "Random", "RecursiveArrayTools", "SafeTestsets", "SparseArrays", "Test", "TestSetExtensions", "Zygote", "oneAPI"]
test = ["Aqua", "ComponentArrays", "ExplicitImports", "FillArrays", "LuxCore", "Pkg", "Random", "RecursiveArrayTools", "SafeTestsets", "SparseArrays", "Test", "TestSetExtensions", "Zygote"]
10 changes: 9 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import Pkg
using Aqua, SafeTestsets, Test, LuxDeviceUtils, TestSetExtensions

const GROUP = get(ENV, "GROUP", "NONE")

@testset ExtendedTestSet "LuxDeviceUtils Tests" begin
if GROUP == "CUDA" || GROUP == "ALL"
Pkg.add("LuxCUDA")
@safetestset "CUDA" include("cuda.jl")
end

if GROUP == "AMDGPU" || GROUP == "ALL"
Pkg.add("LuxAMDGPU")
@safetestset "AMDGPU" include("amdgpu.jl")
end

if GROUP == "Metal" || GROUP == "ALL"
Pkg.add("Metal")
@safetestset "Metal" include("metal.jl")
end

if GROUP == "oneAPI" || GROUP == "ALL"
Pkg.add("oneAPI")
@safetestset "oneAPI" include("oneapi.jl")
end

Expand All @@ -24,6 +29,9 @@ const GROUP = get(ENV, "GROUP", "NONE")

@safetestset "Component Arrays" include("component_arrays.jl")

@safetestset "Explicit Imports" include("explicit_imports.jl")
@safetestset "Explicit Imports" begin
Pkg.add(["LuxCUDA", "LuxAMDGPU", "Metal", "oneAPI"])
include("explicit_imports.jl")
end
end
end

0 comments on commit 520266e

Please sign in to comment.