-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 2.04 KB
/
evaluate_tree_packing.yml
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
name: unoptimized_tree_packing_usage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
evaluate_tree_packing_usage:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: Carnutes
environment-file: environment.yml
- name: activate conda environment
run: conda activate Carnutes
- name: evaluate tree packing usage
run: python -m tests.evaluate_unoptimized_tree_selection
- name: Read RMSE result
id: read-rmse
shell: bash
run: |
if [ -f rmse_result.txt ]; then
rmse=$(cat rmse_result.txt)
echo "rmse=$rmse" >> $GITHUB_ENV
else
echo "rmse=0" >> $GITHUB_ENV
fi
- name: Read tree usage result
id: read-tree-usage
shell: bash
run: |
if [ -f tree_usage_result.txt ]; then
tree_usage=$(cat tree_usage_result.txt)
echo "tree_usage=$tree_usage" >> $GITHUB_ENV
else
echo "tree_usage=0" >> $GITHUB_ENV
fi
- name: Create badges and update README
run: |
# Create badge URLs
rmse_badge="![RMSE](https://img.shields.io/badge/RMSE-${{ env.rmse }}-c7a8ad)"
tree_usage_badge="![Tree Usage](https://img.shields.io/badge/Tree_Usage-${{ env.tree_usage }}-c7a8ad)"
# Replace the placeholder with the actual badges in README.md
sed -i "s|<!-- RMSE BADGE -->|$rmse_badge|" README.md
sed -i "s|<!-- TREE USAGE BADGE -->|$tree_usage_badge|" README.md
- name: Commit and push changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add README.md
git commit -m "Update badges in README"
git push