-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (96 loc) · 3.6 KB
/
performance-tests.yml
File metadata and controls
117 lines (96 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Performance Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
# Run weekly on Sundays at 2 AM UTC
- cron: '0 2 * * 0'
jobs:
performance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Julia
uses: julia-actions/setup-julia@v1
with:
version: '1.10'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-matplotlib python3-sympy
- name: Set environment variables
run: |
echo "QCFD_HOME=${{ github.workspace }}" >> $GITHUB_ENV
echo "QCFD_SRC=${{ github.workspace }}/src/" >> $GITHUB_ENV
- name: Debug paths
working-directory: src/CLBM
run: |
julia debug_paths.jl
- name: Install Julia dependencies
run: |
julia -e '
using Pkg
Pkg.activate(".")
# Add packages without relying on Project.toml UUIDs
try
Pkg.add(["SymPy", "PyPlot", "HDF5", "LaTeXStrings"])
println("✅ Successfully installed Julia packages")
catch e
println("⚠️ Package installation issue: $e")
# Fall back to minimal packages
Pkg.add(["SymPy", "SparseArrays", "LinearAlgebra", "Test"])
end'
- name: Create performance test script
run: |
cat > src/CLBM/performance_test.jl << 'EOF'
# Performance test for different problem sizes
println("Performance Test Results:")
println("=" ^ 50)
# Test cases with different configurations
test_cases = [
(Q=3, truncation_order=2, n_time=10),
(Q=3, truncation_order=3, n_time=20),
(Q=3, truncation_order=4, n_time=10),
]
for (i, case) in enumerate(test_cases)
println("Test Case $i: Q=$(case.Q), truncation_order=$(case.truncation_order), n_time=$(case.n_time)")
# Create a temporary config file for this test case
config_backup = read("clbm_config.jl", String)
# Create modified config
modified_config = replace(config_backup,
r"global Q = \d+" => "global Q = $(case.Q)",
r"global truncation_order = \d+" => "global truncation_order = $(case.truncation_order)",
r"global n_time = \d+" => "global n_time = $(case.n_time)"
)
try
# Write temporary config
write("clbm_config_temp.jl", modified_config)
# Run test with temporary config
success = run(`julia --project=../.. -e "
include(\"clbm_config_temp.jl\")
include(\"unit_tests_minimal.jl\")
println(\"✅ Test case passed\")
"`)
if success.exitcode != 0
error("Test failed")
end
println("✅ PASSED")
catch e
println("❌ FAILED: $e")
exit(1)
finally
# Clean up temporary file
if isfile("clbm_config_temp.jl")
rm("clbm_config_temp.jl")
end
end
println()
end
println("🎉 All performance tests passed!")
EOF
- name: Run performance tests
working-directory: src/CLBM
run: |
julia --project=../.. performance_test.jl