-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.5 KB
/
cml.yaml
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
name: model-training
on: [push]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: iterative/setup-cml@v1
- name: Set up Python environment
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r Streamlit/requirements.txt
- name: Train model
run: |
source venv/bin/activate
python Streamlit/train.py
# Improve this .md
- name: Create report.md
run: |
cat "Streamlit/Training Report/results.txt" > "Streamlit/Training Report/report.md"
echo "" >> "Streamlit/Training Report/report.md"
- name: Commit results and report
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add "Streamlit/Training Report/results.txt"
git add "Streamlit/Training Report/report.md"
git add "Streamlit/Training Report/feature_importance.png"
git add "Streamlit/Training Report/residuals.png"
git commit -m "Add model results and report"
git push
- name: Create CML Report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
source venv/bin/activate
cml comment create "Streamlit/Training Report/report.md" --token ${{ secrets.GITHUB_TOKEN }}