Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Readme.md during CI run #58

Merged
merged 12 commits into from
Aug 23, 2024
36 changes: 35 additions & 1 deletion .github/workflows/before_merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ name: "Tests"
on:
workflow_call:
workflow_dispatch:
inputs:
commit_report:
description: 'Commit generated report files: None, Readme, All'
required: false
default: 'None'
merge_group:

permissions:
actions: read
contents: read
contents: write
pages: write
id-token: write

Expand Down Expand Up @@ -35,6 +40,7 @@ jobs:
source venv/bin/activate
python3 -m pytest --github-report tests/tools/ -s
- name: Run Lowering Tests
id: lowering_tests
env:
pytest_verbosity: 2
pytest_report_title: "⭐️ Aten → TTNN Lowering Tests"
Expand All @@ -48,9 +54,37 @@ jobs:
echo "TT_METAL_WATCHER_APPEND=0" >> $GITHUB_ENV
echo "TT_METAL_WATCHER_DUMP_ALL=1" >> $GITHUB_ENV
- name: Run Model Tests
id: model_tests
if: steps.lowering_tests.outcome == 'success'
env:
pytest_verbosity: 2
pytest_report_title: "⭐️ Model Tests"
run: |
source venv/bin/activate
python3 -m pytest --github-report tests/models/ -s
- name: Collect Metrics Report
if: ${{ github.event_name == 'workflow_dispatch' && steps.lowering_tests.outcome == 'success' && steps.model_tests.outcome == 'success' }}
env:
PYTHONPATH: ${{ github.workspace }}
run: |
source venv/bin/activate
python3 tools/collect_metrics.py
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git status

if [ "${{ github.event.inputs.commit_option }}" == "All" ]; then
git add .
elif [ "${{ github.event.inputs.commit_option }}" == "Readme" ]; then
git add README.md
elif [ "${{ github.event.inputs.commit_option }}" == "None" ]; then
echo "No files will be committed"
exit 0
fi

if git diff-index --quiet HEAD; then
echo "No changes to commit"
else
git commit -m '[auto][on-merge-queue] Update metrics report in README.md'
git push
fi
Loading