-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (69 loc) · 2.42 KB
/
Copy pathsync_runtime.yml
File metadata and controls
82 lines (69 loc) · 2.42 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
name: Sync SOLAR Runtime
on:
workflow_dispatch:
inputs:
adapter_ref:
description: "solar_adapter branch, tag, or commit"
required: false
default: "main"
repository_dispatch:
types: [solar-runtime-updated]
permissions:
contents: write
jobs:
sync-runtime:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout solar_adapter
uses: actions/checkout@v4
with:
repository: optiprofiler/solar_adapter
path: solar_adapter
ref: ${{ github.event.client_payload.adapter_ref || github.event.inputs.adapter_ref || 'main' }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Configure Git identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Generate slim runtime from adapter
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
bash solar_adapter/scripts/sync_solar.sh
bash solar_adapter/scripts/export_runtime.sh solar_adapter/build/solar-runtime
- name: Copy runtime into Python wrapper
run: |
rsync -a --delete \
--exclude='bin/solar' \
--exclude='bin/solar.exe' \
--exclude='src/*.o' \
solar_adapter/build/solar-runtime/ runtime/solar/
rm -f runtime/solar/bin/solar runtime/solar/bin/solar.exe runtime/solar/src/*.o
rm -rf runtime/solar/.build.lock.d
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install git+https://github.com/optiprofiler/optiprofiler.git
- name: Regenerate probinfo
run: |
python scripts/collect_info.py
- name: Run tests
run: |
python -m unittest discover -s tests -p 'test_*.py'
- name: Commit runtime update
run: |
rm -f runtime/solar/bin/solar runtime/solar/bin/solar.exe runtime/solar/src/*.o
rm -rf runtime/solar/.build.lock.d
git add runtime/solar
if git diff --staged --quiet; then
echo "No runtime changes detected."
else
git commit -m "Sync SOLAR runtime from adapter"
git push
fi