Create LICENSE (#1) #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CML CI | |
on: | |
push: | |
branches: | |
- main | |
# Runs on pull requests | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
report-pr: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
with: | |
# Fetch all history for DVC | |
fetch-depth: 0 | |
- name: Setup DVC | |
uses: iterative/setup-dvc@v1 | |
with: | |
version: "2.52.0" | |
- name: Setup CML | |
uses: iterative/setup-cml@v1 | |
with: | |
version: "0.18.21" | |
- name: Login to Google Cloud | |
uses: "google-github-actions/auth@v1" | |
with: | |
credentials_json: "${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}" | |
- name: Download DVC cache | |
run: | | |
dvc pull | |
- name: Create CML report | |
env: | |
REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
run: | | |
# Compare parameters to main branch | |
echo "# Params workflow vs. main" >> report.md | |
echo >> report.md | |
dvc params diff main --show-md >> report.md | |
echo >> report.md | |
# Compare metrics to main branch | |
echo "# Metrics workflow vs. main" >> report.md | |
echo >> report.md | |
dvc metrics diff main --show-md >> report.md | |
echo >> report.md | |
# Create plots | |
echo "# Models" >> report.md | |
echo >> report.md | |
# Compare localize images to main branch | |
echo "## Localize Validation Loss" >> report.md | |
echo >> report.md | |
dvc plots diff \ | |
--target out/runs/localize/plots/metrics/validation/loss.tsv \ | |
--show-vega main > vega.json | |
vl2png vega.json > localize_diff.png | |
echo '![](./localize_diff.png "Localize model val loss")' >> report.md | |
echo >> report.md | |
# Compare ocr images to main branch | |
echo "## OCR Validation Loss" >> report.md | |
echo >> report.md | |
dvc plots diff \ | |
--target out/runs/ocr/plots/metrics/validation/loss.tsv \ | |
--show-vega main > vega.json | |
vl2png vega.json > ocr_diff.png | |
echo '![](./ocr_diff.png "OCR model val loss")' >> report.md | |
echo >> report.md | |
# NOTE: dvc plots diff with images does not work with vega-lite | |
# Compare stack images to main branch | |
# echo "## Stack prediction" >> report.md | |
# echo >> report.md | |
# dvc plots diff \ | |
# --target out/evaluations/stack/plots/images/stack_pred_0.png \ | |
# --show-vega main > vega.json | |
# vl2png vega.json > stack_diff.png | |
# echo '![](./stack_diff.png "Stack prediction")' >> report.md | |
# echo >> report.md | |
cml comment create --target=pr --publish report.md |