forked from NSPG13/agent-bounties
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.63 KB
/
Copy pathcode-size-report.yml
File metadata and controls
63 lines (54 loc) · 1.63 KB
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
name: Code Size Report
on:
pull_request:
schedule:
- cron: "23 7 * * 1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: code-size-${{ github.ref }}
cancel-in-progress: true
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Test reporter
run: python scripts/test_code_size_report.py -v
- name: Select comparison
id: comparison
shell: bash
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
if [[ -n "$PR_BASE_SHA" ]]; then
base_ref="$PR_BASE_SHA"
else
base_ref="$(git rev-list -1 --before='7 days ago' HEAD)"
fi
if [[ -z "$base_ref" ]]; then
base_ref="$(git rev-list --max-parents=0 HEAD | tail -n 1)"
fi
echo "base_ref=$base_ref" >> "$GITHUB_OUTPUT"
- name: Build report
run: |
python scripts/code_size_report.py \
--head-ref HEAD \
--base-ref "${{ steps.comparison.outputs.base_ref }}" \
--json-out target/code-size/report.json \
--markdown-out target/code-size/report.md
cat target/code-size/report.md >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@v7.0.1
with:
name: code-size-${{ github.run_id }}
path: |
target/code-size/report.json
target/code-size/report.md
if-no-files-found: error
retention-days: 90