summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-03-12 15:48:49 +0700
committerhathach <[email protected]>2026-03-12 15:48:49 +0700
commit2052111bac10fc3184b1dd9558fc1b9ab5c85ea4 (patch)
tree5fc7a4fa6b24a97eda26dda3b1a9572d4c9b1aa1
parent222af862aa2b3898980e3ed8f28e70fe6c9a7ee9 (diff)
chore(workflows): update GitHub Actions dependencies and improve membrowse error handling
update AGENTS.md with metrics compare
-rw-r--r--.github/workflows/build_util.yml1
-rw-r--r--.github/workflows/cifuzz.yml2
-rw-r--r--.github/workflows/claude-code-review.yml2
-rw-r--r--.github/workflows/claude.yml2
-rw-r--r--.github/workflows/membrowse-onboard.yml6
-rw-r--r--.github/workflows/metrics_comment.yml2
-rw-r--r--AGENTS.md45
7 files changed, 53 insertions, 7 deletions
diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml
index d03c9af81..c9b0d36d9 100644
--- a/.github/workflows/build_util.yml
+++ b/.github/workflows/build_util.yml
@@ -79,6 +79,7 @@ jobs:
- name: Membrowse Upload
if: inputs.toolchain != 'esp-idf' && inputs.upload-membrowse == true
+ continue-on-error: true
env:
MEMBROWSE_API_KEY: ${{ secrets.MEMBROWSE_API_KEY }}
run: |
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml
index d7f1fc066..9b3756a72 100644
--- a/.github/workflows/cifuzz.yml
+++ b/.github/workflows/cifuzz.yml
@@ -29,7 +29,7 @@ jobs:
fuzz-seconds: 400
- name: Upload Crash
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v5
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml
index 5d7efc115..43144bb5e 100644
--- a/.github/workflows/claude-code-review.yml
+++ b/.github/workflows/claude-code-review.yml
@@ -16,7 +16,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
with:
fetch-depth: 1
diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml
index 9471a0591..50f449949 100644
--- a/.github/workflows/claude.yml
+++ b/.github/workflows/claude.yml
@@ -26,7 +26,7 @@ jobs:
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
with:
fetch-depth: 1
diff --git a/.github/workflows/membrowse-onboard.yml b/.github/workflows/membrowse-onboard.yml
index aa7204ffa..4b9e54cff 100644
--- a/.github/workflows/membrowse-onboard.yml
+++ b/.github/workflows/membrowse-onboard.yml
@@ -17,7 +17,7 @@ jobs:
toolchains: ${{ steps.load.outputs.toolchains }}
steps:
- name: Checkout repository
- uses: actions/checkout@v5
+ uses: actions/checkout@v6
- name: Load target matrix
id: load
@@ -35,7 +35,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v5
+ uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
@@ -45,7 +45,7 @@ jobs:
${{ fromJson(needs.load-targets.outputs.toolchains)[matrix.toolchain].setup_cmd }} && python3 tools/get_deps.py ${{ matrix.get_deps || matrix.port }}
- name: Setup ccache
- uses: hendrikmuhs/[email protected]
+ uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.port }}-${{ matrix.board }}
diff --git a/.github/workflows/metrics_comment.yml b/.github/workflows/metrics_comment.yml
index 7443f7367..5d250211f 100644
--- a/.github/workflows/metrics_comment.yml
+++ b/.github/workflows/metrics_comment.yml
@@ -17,7 +17,7 @@ jobs:
pull-requests: write
steps:
- name: Download Artifacts
- uses: actions/download-artifact@v4
+ uses: actions/download-artifact@v5
with:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/AGENTS.md b/AGENTS.md
index bbbd7c36d..4e510b01e 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -211,6 +211,51 @@ take 2-5 minutes. NEVER CANCEL. Set timeout to 20+ minutes.
- Install requirements: `pip install -r docs/requirements.txt`
- Build docs: `cd docs && sphinx-build -b html . _build` -- takes 2-3 seconds. NEVER CANCEL. Set timeout to 10+ minutes.
+## Code Size Metrics
+
+Generate and compare code size metrics to evaluate the impact of changes. This is the most common workflow
+when making code changes — use it to verify size impact before committing.
+
+**Quick single-board metrics (preferred for iterative development):**
+
+```bash
+rm -rf cmake-build
+python3 tools/build.py -b raspberry_pi_pico --target all --target tinyusb_metrics
+python3 tools/metrics.py combine -j -m -f tinyusb/src cmake-build/cmake-build-*/metrics.json
+```
+
+This builds all examples for one board and produces `metrics.json` + `metrics.md`. Takes ~30 seconds.
+NEVER CANCEL. Set timeout to 10+ minutes.
+
+**Comparing with master (before/after workflow):**
+
+1. On master: build and save baseline
+ ```bash
+ rm -rf cmake-build
+ python3 tools/build.py -b raspberry_pi_pico --target all --target tinyusb_metrics
+ python3 tools/metrics.py combine -j -m -f tinyusb/src cmake-build/cmake-build-*/metrics.json
+ mv metrics.json metrics_master.json
+ ```
+2. Switch to your branch: rebuild
+ ```bash
+ rm -rf cmake-build
+ python3 tools/build.py -b raspberry_pi_pico --target all --target tinyusb_metrics
+ python3 tools/metrics.py combine -j -m -f tinyusb/src cmake-build/cmake-build-*/metrics.json
+ ```
+3. Compare: `python3 tools/metrics.py compare -m -f tinyusb/src metrics_master.json metrics.json`
+ Produces `metrics_compare.md` showing size differences.
+
+**Full CI metrics (all arm-gcc families, for thorough validation):**
+
+```bash
+rm -rf cmake-build
+FAMILIES=$(python3 .github/workflows/ci_set_matrix.py | python3 -c "import sys,json; d=json.load(sys.stdin); print(' '.join(d.get('arm-gcc',[])))")
+python3 tools/build.py --one-first --target all --target tinyusb_metrics $FAMILIES
+python3 tools/metrics.py combine -j -m -f tinyusb/src cmake-build/cmake-build-*/metrics.json
+```
+
+Builds the first board of each family. Takes 2-4 minutes. NEVER CANCEL. Set timeout to 10+ minutes.
+
## Code Quality and Validation
- Format code: `clang-format -i path/to/file.c` (uses `.clang-format` config)