Skip to content

Commit 5b23597

Browse files
committed
Update use of cml cli.
The cli for cml has been updated, it's best if our examples use the new command structure.
1 parent cfa4ca4 commit 5b23597

File tree

1 file changed

+12
-7
lines changed
  • example-get-started/code/.github/workflows

1 file changed

+12
-7
lines changed

example-get-started/code/.github/workflows/cml.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
- uses: iterative/setup-dvc@v1
99
- uses: actions/checkout@v3
1010
with:
11+
ref: ${{ github.event.pull_request.head.sha }}
1112
fetch-depth: 2
1213
- name: Generate metrics report
1314
env:
@@ -20,20 +21,24 @@ jobs:
2021
PREVIOUS_REF=main
2122
fi
2223
23-
echo "# CML Report" > report.md
24-
echo "## Plots" >> report.md
24+
cat <<EOF > report.md
25+
# CML Report
26+
## Plots
27+
![Prevision & Recall](./prc.svg)
28+
![Confusion Matrix](./confusion.svg)
29+
30+
## Metrics and Params
31+
### ${PREVIOUS_REF} → workspace
32+
EOF
33+
2534
dvc plots diff $PREVIOUS_REF workspace \
2635
--show-vega --targets evaluation/plots/precision_recall.json > vega.json
2736
vl2svg vega.json prc.svg
28-
cml publish prc.svg --title "Precision & Recall" --md >> report.md
2937
3038
dvc plots diff $PREVIOUS_REF workspace \
3139
--show-vega --targets evaluation/plots/confusion_matrix.json > vega.json
3240
vl2svg vega.json confusion.svg
33-
cml publish confusion.svg --title "Confusion Matrix" --md >> report.md
3441
35-
echo "## Metrics and Params" >> report.md
36-
echo "### $PREVIOUS_REF → workspace" >> report.md
3742
dvc exp diff $PREVIOUS_REF --show-md >> report.md
3843
39-
cml send-comment report.md
44+
cml comment create --publish --pr report.md

0 commit comments

Comments
 (0)