Skip to content

Commit e5af4a9

Browse files
committed
Modiy action
1 parent 5d40c36 commit e5af4a9

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

.github/actions/collect_info/s_getInfo.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
import os
1515
import sys
1616

17-
# Add the repository root to path so we can import s2mpj_tools
17+
# Get the repository root directory (three levels up from this script)
1818
cwd = os.path.dirname(os.path.abspath(__file__))
1919
repo_root = os.path.abspath(os.path.join(cwd, '..', '..', '..'))
20-
sys.path.insert(0, repo_root)
2120

22-
from s2mpj_tools import s2mpj_load
21+
# Add optiprofiler to the system path (checked out by GitHub Actions)
22+
sys.path.append(os.path.join(repo_root, 'optiprofiler'))
23+
sys.path.append(os.path.join(repo_root, 'optiprofiler', 'problems'))
24+
from problems.s2mpj.s2mpj_tools import s2mpj_load
2325

2426
# Set the timeout (seconds) for each problem to be loaded
2527
timeout = 50

.github/workflows/collect_info.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,22 @@ jobs:
3333
python-version: '3.11'
3434
check-latest: true
3535

36-
# Step 3: Install dependencies
36+
# Step 3: Checkout OptiProfiler (contains required class definitions)
37+
- name: Checkout OptiProfiler
38+
uses: actions/checkout@v4
39+
with:
40+
repository: optiprofiler/optiprofiler
41+
path: optiprofiler
42+
submodules: recursive
43+
ref: python
44+
45+
# Step 4: Install dependencies
3746
- name: Install Python dependencies
3847
run: |
3948
python -m pip install --upgrade pip
4049
pip install -r .github/actions/collect_info/requirements.txt
4150
42-
# Step 4: Run the info collection script
51+
# Step 5: Run the info collection script
4352
- name: Collect problem information
4453
run: python .github/actions/collect_info/s_getInfo.py
4554

0 commit comments

Comments
 (0)