2025-11-05 17:45:27 -05:00
|
|
|
name: Generate Power Graph
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
2025-11-07 12:10:31 -05:00
|
|
|
branches: [ master, dev ]
|
2025-11-05 18:26:17 -05:00
|
|
|
paths: [ power_log.csv ]
|
2025-11-05 17:45:27 -05:00
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
plot:
|
2025-11-09 14:37:49 -05:00
|
|
|
runs-on: [docker]
|
2025-11-05 18:17:37 -05:00
|
|
|
env:
|
|
|
|
|
BRANCH: ${{ github.ref_name }}
|
|
|
|
|
COMMIT: ${{ github.sha }}
|
2025-11-05 17:45:27 -05:00
|
|
|
steps:
|
2025-11-05 18:17:37 -05:00
|
|
|
- name: Clone repository manually
|
|
|
|
|
run: |
|
|
|
|
|
git clone --branch "$BRANCH" https://${{ secrets.PAT_READ_REPO }}@mentalnet.xyz/forgejo/markmental/amd-monitor.git .
|
|
|
|
|
echo "✅ Checked out branch $BRANCH ($COMMIT)"
|
2025-11-05 17:45:27 -05:00
|
|
|
|
2025-11-05 18:26:17 -05:00
|
|
|
- name: Install Python and deps (venv)
|
2025-11-05 17:45:27 -05:00
|
|
|
run: |
|
2025-11-05 18:26:17 -05:00
|
|
|
apt-get update
|
|
|
|
|
apt-get install -y python3-full python3-venv
|
|
|
|
|
python3 -m venv venv
|
|
|
|
|
. venv/bin/activate
|
|
|
|
|
pip install --upgrade pip
|
|
|
|
|
pip install matplotlib pandas
|
2025-11-05 17:45:27 -05:00
|
|
|
|
|
|
|
|
- name: Generate power graph
|
|
|
|
|
run: |
|
2025-11-05 18:26:17 -05:00
|
|
|
. venv/bin/activate
|
|
|
|
|
python plot_power.py
|
2025-11-05 17:45:27 -05:00
|
|
|
|
|
|
|
|
- name: Upload graph artifact
|
2025-11-05 18:17:37 -05:00
|
|
|
uses: actions/upload-artifact@v3
|
2025-11-05 17:45:27 -05:00
|
|
|
with:
|
|
|
|
|
name: power-graph
|
|
|
|
|
path: power_graph.png
|