diff --git a/.circleci/config2.yml b/.circleci/config2.yml index 352d0f4fa..900994a73 100644 --- a/.circleci/config2.yml +++ b/.circleci/config2.yml @@ -110,7 +110,7 @@ commands: no_output_timeout: 20m command: | if [ << parameters.toolchain >> == esp-idf ]; then - docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.2 python tools/build.py << parameters.build-args >> << parameters.family >> + docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.2 python tools/build.py << parameters.build-args >> --target all << parameters.family >> else # Toolchain option default is gcc if [ << parameters.toolchain >> == arm-clang ]; then @@ -124,7 +124,12 @@ commands: # circleci docker return $nproc as 36 core, limit parallel to 4 (resource-class = large) # Required for IAR, also prevent crashed/killed by docker - python tools/build.py -s << parameters.build-system >> $TOOLCHAIN_OPTION -j 4 << parameters.build-args >> << parameters.family >> + BUILD_PY_ARGS="-s << parameters.build-system >> $TOOLCHAIN_OPTION -j 4 << parameters.build-args >>" + python tools/build.py $BUILD_PY_ARGS --target all << parameters.family >> + + if [ << parameters.build-system >> == "cmake" ]; then + python tools/build.py $BUILD_PY_ARGS --target tinyusb_metrics << parameters.family >> + fi fi # Only collect and persist metrics for cmake builds (excluding esp-idf and --one-random) diff --git a/.github/actions/get_deps/action.yml b/.github/actions/get_deps/action.yml index 8ea36ce78..bbe94f0fa 100644 --- a/.github/actions/get_deps/action.yml +++ b/.github/actions/get_deps/action.yml @@ -23,7 +23,6 @@ runs: wget $NINJA_URL -O ninja-linux.zip unzip ninja-linux.zip -d ninja-bin pip install membrowse - #echo >> $GITHUB_PATH "$HOME/.local/bin" echo >> $GITHUB_PATH "${{ github.workspace }}/ninja-bin" shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0997c256..9d8b90f5a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -336,53 +336,3 @@ jobs: - name: Test on actual hardware (hardware in the loop) run: python3 test/hil/hil_test.py hfp.json - - # --------------------------------------- - # Membrowse Memory Analysis - # Push: always runs (uses identical for doc-only to maintain commit chain) - # PR: only runs if code changed (doc-only PRs skip entirely) - # --------------------------------------- -# membrowse: -# needs: [check-paths, cmake] -# if: | -# always() && !cancelled() && ( -# github.event_name == 'push' || -# github.event_name == 'release' || -# github.event_name == 'workflow_dispatch' || -# (github.event_name == 'pull_request' && needs.check-paths.outputs.code_changed == 'true') -# ) -# permissions: -# contents: read -# actions: read -# uses: ./.github/workflows/membrowse-report.yml -# with: -# code_changed: ${{ needs.check-paths.outputs.code_changed == 'true' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }} -# secrets: inherit -# -# membrowse-comment: -# needs: membrowse -# # skip membrowse comment since it is too verbal -# if: false && github.event_name == 'pull_request' -# runs-on: ubuntu-latest -# permissions: -# contents: read -# actions: read -# steps: -# - name: Checkout repository -# uses: actions/checkout@v6 -# -# - name: Download report artifacts -# id: download -# uses: actions/download-artifact@v5 -# with: -# pattern: membrowse-report-* -# path: reports -# merge-multiple: true -# continue-on-error: true -# -# - name: Upload Membrowse Comment Artifact -# if: steps.download.outcome == 'success' -# uses: actions/upload-artifact@v5 -# with: -# name: membrowse-comment -# path: reports/ diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml index 7b1972fc9..b0adec979 100644 --- a/.github/workflows/build_util.yml +++ b/.github/workflows/build_util.yml @@ -67,7 +67,7 @@ jobs: IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }} run: | if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then - docker run --rm -e MEMBROWSE_API_KEY="$MEMBROWSE_API_KEY" -v $PWD:/project -w /project espressif/idf:tinyusb python tools/build.py -T all ${{ matrix.arg }} + docker run --rm -e MEMBROWSE_API_KEY="$MEMBROWSE_API_KEY" -v $PWD:/project -w /project espressif/idf:tinyusb python tools/build.py --target all ${{ matrix.arg }} else BUILD_PY_ARGS="-s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ inputs.build-options }}" python tools/build.py $BUILD_PY_ARGS --target all ${{ matrix.arg }} @@ -90,14 +90,14 @@ jobs: shell: bash - name: Upload Artifacts for Metrics - if: ${{ inputs.upload-metrics }} + if: inputs.upload-metrics == true && inputs.code-changed == true uses: actions/upload-artifact@v5 with: name: metrics-${{ matrix.arg }} path: cmake-build/cmake-build-*/metrics.json - name: Upload Artifacts for Hardware Testing - if: ${{ inputs.upload-artifacts }} + if: inputs.upload-artifacts == true && inputs.code-changed == true uses: actions/upload-artifact@v5 with: name: binaries-${{ matrix.arg }} diff --git a/.github/workflows/membrowse-report.yml b/.github/workflows/membrowse-report.yml deleted file mode 100644 index f86b047df..000000000 --- a/.github/workflows/membrowse-report.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: Membrowse Memory Report - -on: - workflow_call: - inputs: - code_changed: - description: 'Whether code paths changed (true) or doc-only (false)' - type: boolean - required: true - -permissions: - contents: read - actions: read - -jobs: - load-targets: - runs-on: ubuntu-latest - outputs: - targets: ${{ steps.load.outputs.targets }} - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Load target matrix - id: load - run: echo "targets=$(jq -c '.targets' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT - - analyze: - needs: [load-targets] - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: ${{ fromJson(needs.load-targets.outputs.targets) }} - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - # Download artifacts when code changed (build artifacts available) - - name: Download build artifacts - if: inputs.code_changed - id: download - uses: actions/download-artifact@v5 - with: - pattern: binaries-* - path: cmake-build - merge-multiple: true - continue-on-error: true - - - name: Restore linker scripts - if: inputs.code_changed - run: cp -r cmake-build/hw . 2>/dev/null || true - - - name: Check if ELF exists - id: check-elf - run: | - if [ -f "cmake-build/cmake-build-${{ matrix.board }}/device/${{ matrix.example }}/${{ matrix.example }}.elf" ]; then - echo "exists=true" >> $GITHUB_OUTPUT - else - echo "exists=false" >> $GITHUB_OUTPUT - fi - - # Run with actual ELF analysis when build artifacts available - - name: Run Membrowse Analysis - if: steps.check-elf.outputs.exists == 'true' - id: membrowse - continue-on-error: true - uses: membrowse/membrowse-action@v1 - with: - target_name: ${{ matrix.port }}-${{ matrix.board }}-${{ matrix.example }} - elf: cmake-build/cmake-build-${{ matrix.board }}/device/${{ matrix.example }}/${{ matrix.example }}.elf - ld: ${{ matrix.ld }} - linker_vars: ${{ matrix.linker_vars || '' }} - api_key: ${{ secrets.MEMBROWSE_API_KEY }} - api_url: ${{ vars.MEMBROWSE_API_URL }} - verbose: INFO - - # Run with identical=true when no ELF (doc-only push) - # Preserves the chain of commits in membrowse tracking - - name: Run Membrowse Identical Report - if: steps.check-elf.outputs.exists == 'false' - id: membrowse-identical - continue-on-error: true - uses: membrowse/membrowse-action@v1 - with: - target_name: ${{ matrix.port }}-${{ matrix.board }}-${{ matrix.example }} - identical: true - api_key: ${{ secrets.MEMBROWSE_API_KEY }} - api_url: ${{ vars.MEMBROWSE_API_URL }} - verbose: INFO - - - name: Upload report artifact - if: steps.membrowse.outcome == 'success' || steps.membrowse-identical.outcome == 'success' - uses: actions/upload-artifact@v5 - with: - name: membrowse-report-${{ matrix.port }}-${{ matrix.board }}-${{ matrix.example }} - path: ${{ steps.membrowse.outputs.report_path || steps.membrowse-identical.outputs.report_path }} diff --git a/.idea/cmake.xml b/.idea/cmake.xml index 5f9e1acd2..822a70236 100644 --- a/.idea/cmake.xml +++ b/.idea/cmake.xml @@ -171,6 +171,7 @@ +