50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
|
|
name: Generate Power Graph
|
||
|
|
|
||
|
|
on:
|
||
|
|
push:
|
||
|
|
branches:
|
||
|
|
- main
|
||
|
|
paths:
|
||
|
|
- power_log.csv
|
||
|
|
|
||
|
|
jobs:
|
||
|
|
plot:
|
||
|
|
runs-on: [self-hosted]
|
||
|
|
steps:
|
||
|
|
- name: Checkout repo
|
||
|
|
run: |
|
||
|
|
git clone https://mentalnet.xyz/forgejo/markmental/amd-telemetry.git .
|
||
|
|
echo "✅ Repository checked out"
|
||
|
|
|
||
|
|
- name: Install Python deps
|
||
|
|
run: |
|
||
|
|
sudo apt update
|
||
|
|
sudo apt install -y python3 python3-pip
|
||
|
|
pip install matplotlib pandas
|
||
|
|
|
||
|
|
- name: Generate power graph
|
||
|
|
run: |
|
||
|
|
python3 - <<'EOF'
|
||
|
|
import pandas as pd, matplotlib.pyplot as plt
|
||
|
|
df = pd.read_csv('power_log.csv', names=['time','apu','gpu','total'])
|
||
|
|
plt.figure(figsize=(10,5))
|
||
|
|
plt.plot(df['time'], df['apu'], label='APU Power (W)', color='orange')
|
||
|
|
plt.plot(df['time'], df['gpu'], label='GPU Power (W)', color='green')
|
||
|
|
plt.plot(df['time'], df['total'], label='Total (W)', color='blue', linewidth=1.5)
|
||
|
|
plt.xlabel('Time')
|
||
|
|
plt.ylabel('Watts')
|
||
|
|
plt.title('AMD TUF Power Log')
|
||
|
|
plt.legend()
|
||
|
|
plt.xticks(rotation=45)
|
||
|
|
plt.tight_layout()
|
||
|
|
plt.grid(True, alpha=0.3)
|
||
|
|
plt.savefig('power_graph.png', dpi=120)
|
||
|
|
print('✅ Graph generated: power_graph.png')
|
||
|
|
EOF
|
||
|
|
|
||
|
|
- name: Upload graph artifact
|
||
|
|
uses: actions/upload-artifact@v3
|
||
|
|
with:
|
||
|
|
name: power-graph
|
||
|
|
path: power_graph.png
|
||
|
|
|