Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit292f6d0

Browse files
committed
ci: Integrate Membrowse to PR flow
Signed-off-by: Michael Rogov Papernov <michael@membrowse.com>
1 parent2bd337e commit292f6d0

File tree

5 files changed

+279
-1
lines changed

5 files changed

+279
-1
lines changed

‎.github/membrowse-targets.json‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[
2+
{
3+
"target_name":"stm32-pybv11",
4+
"port":"stm32",
5+
"board":"PYBV11",
6+
"setup_cmd":"tools/ci.sh stm32_setup && mkdir -p /tmp/bin && mv arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi /tmp/bin/",
7+
"build_cmd":"export PATH=/tmp/bin/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin:$PATH && make -C mpy-cross && make -C ports/stm32 submodules && make -C ports/stm32 BOARD=PYBV11",
8+
"elf":"ports/stm32/build-PYBV11/firmware.elf",
9+
"ld":"ports/stm32/boards/stm32f405.ld ports/stm32/boards/common_ifs.ld"
10+
},
11+
{
12+
"target_name":"rp2-pico",
13+
"port":"rp2",
14+
"board":"RPI_PICO",
15+
"setup_cmd":"tools/ci.sh rp2_setup",
16+
"build_cmd":"make -C mpy-cross && make -C ports/rp2 submodules && make -C ports/rp2 BOARD=RPI_PICO",
17+
"elf":"ports/rp2/build-RPI_PICO/firmware.elf",
18+
"ld":"ports/rp2/memmap_mp_rp2040.ld",
19+
"linker_vars":"__micropy_flash_size__=2048k __micropy_c_heap_size__=0"
20+
},
21+
{
22+
"target_name":"samd-itsybitsy-m4",
23+
"port":"samd",
24+
"board":"ADAFRUIT_ITSYBITSY_M4_EXPRESS",
25+
"setup_cmd":"tools/ci.sh samd_setup",
26+
"build_cmd":"make -C mpy-cross && make -C ports/samd submodules && make -C ports/samd BOARD=ADAFRUIT_ITSYBITSY_M4_EXPRESS",
27+
"elf":"ports/samd/build-ADAFRUIT_ITSYBITSY_M4_EXPRESS/firmware.elf",
28+
"ld":"ports/samd/boards/samd51x19a.ld ports/samd/sections.ld",
29+
"linker_vars":"_codesize=496K"
30+
},
31+
{
32+
"target_name":"mimxrt-teensy40",
33+
"port":"mimxrt",
34+
"board":"TEENSY40",
35+
"setup_cmd":"tools/ci.sh mimxrt_setup",
36+
"build_cmd":"make -C mpy-cross && make -C ports/mimxrt BOARD=TEENSY40 submodules && make -C ports/mimxrt BOARD=TEENSY40",
37+
"elf":"ports/mimxrt/build-TEENSY40/firmware.elf",
38+
"ld":"ports/mimxrt/boards/MIMXRT1062.ld ports/mimxrt/boards/common.ld",
39+
"linker_vars":"flash_start=0x60000000 flash_size=0x200000 vfs_start=0x60100000 vfs_size=0x100000 reserved_size=0"
40+
},
41+
{
42+
"target_name":"nrf-pca10040",
43+
"port":"nrf",
44+
"board":"PCA10040",
45+
"setup_cmd":"tools/ci.sh nrf_setup",
46+
"build_cmd":"make -C mpy-cross && make -C ports/nrf submodules && make -C ports/nrf BOARD=PCA10040",
47+
"elf":"ports/nrf/build-PCA10040/firmware.elf",
48+
"ld":"ports/nrf/boards/nrf52832_512k_64k.ld ports/nrf/boards/memory.ld ports/nrf/boards/common.ld"
49+
},
50+
{
51+
"target_name":"renesas-ra-ek-ra6m2",
52+
"port":"renesas-ra",
53+
"board":"EK_RA6M2",
54+
"setup_cmd":"tools/ci.sh renesas_ra_setup",
55+
"build_cmd":"make -C mpy-cross && make -C ports/renesas-ra submodules && make -C ports/renesas-ra BOARD=EK_RA6M2",
56+
"elf":"ports/renesas-ra/build-EK_RA6M2/firmware.elf",
57+
"ld":"ports/renesas-ra/boards/EK_RA6M2/ra6m2_ek.ld"
58+
},
59+
{
60+
"target_name":"qemu-mps2-an385",
61+
"port":"qemu",
62+
"board":"MPS2_AN385",
63+
"setup_cmd":"tools/ci.sh qemu_setup_arm",
64+
"build_cmd":"make -C mpy-cross && make -C ports/qemu BOARD=MPS2_AN385 submodules && make -C ports/qemu BOARD=MPS2_AN385",
65+
"elf":"ports/qemu/build-MPS2_AN385/firmware.elf",
66+
"ld":"ports/qemu/mcu/arm/mps2.ld"
67+
},
68+
{
69+
"target_name":"qemu-virt-rv32",
70+
"port":"qemu",
71+
"board":"VIRT_RV32",
72+
"setup_cmd":"tools/ci.sh qemu_setup_rv32",
73+
"build_cmd":"make -C mpy-cross && make -C ports/qemu BOARD=VIRT_RV32 submodules && make -C ports/qemu BOARD=VIRT_RV32",
74+
"elf":"ports/qemu/build-VIRT_RV32/firmware.elf",
75+
"ld":"ports/qemu/mcu/rv32/virt.ld"
76+
}
77+
]
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name:Membrowse PR Comment
2+
# Posts PR comments after Membrowse Memory Report workflow completes
3+
# Uses workflow_run trigger to have elevated permissions for fork PRs
4+
5+
on:
6+
workflow_run:
7+
workflows:[Membrowse Memory Report]
8+
types:[completed]
9+
10+
permissions:
11+
contents:read
12+
actions:read
13+
pull-requests:write
14+
15+
jobs:
16+
comment:
17+
runs-on:ubuntu-22.04
18+
if:github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
19+
steps:
20+
-name:Checkout repository
21+
uses:actions/checkout@v5
22+
23+
-name:Download report artifacts
24+
id:download-reports
25+
uses:actions/github-script@v7
26+
with:
27+
result-encoding:string
28+
script:|
29+
const fs = require('fs');
30+
31+
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
run_id: context.payload.workflow_run.id,
35+
});
36+
37+
// Find all membrowse report artifacts
38+
const reportArtifacts = allArtifacts.data.artifacts.filter(
39+
artifact => artifact.name.startsWith('membrowse-report-')
40+
);
41+
42+
if (reportArtifacts.length === 0) {
43+
console.log('No report artifacts found');
44+
return 'skip';
45+
}
46+
47+
// Create reports directory
48+
fs.mkdirSync('reports', { recursive: true });
49+
50+
// Download and extract each report
51+
for (const artifact of reportArtifacts) {
52+
console.log(`Downloading ${artifact.name}...`);
53+
const download = await github.rest.actions.downloadArtifact({
54+
owner: context.repo.owner,
55+
repo: context.repo.repo,
56+
artifact_id: artifact.id,
57+
archive_format: 'zip',
58+
});
59+
60+
const zipPath = `${artifact.name}.zip`;
61+
fs.writeFileSync(zipPath, Buffer.from(download.data));
62+
63+
// Extract to reports directory
64+
await exec.exec('unzip', ['-o', zipPath, '-d', 'reports']);
65+
}
66+
67+
return 'ok';
68+
69+
-name:Post combined PR comment
70+
if:steps.download-reports.outputs.result == 'ok'
71+
uses:membrowse/membrowse-action/comment-action@main
72+
with:
73+
json_files:"reports/*.json"
74+
env:
75+
GH_TOKEN:${{ secrets.GITHUB_TOKEN }}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name:Onboard to Membrowse
2+
# Membrowse onboarding workflow for historical analysis
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
num_commits:
8+
description:'Number of commits to process'
9+
required:true
10+
default:'100'
11+
type:string
12+
13+
jobs:
14+
load-targets:
15+
runs-on:ubuntu-22.04
16+
outputs:
17+
matrix:${{ steps.set-matrix.outputs.matrix }}
18+
steps:
19+
-name:Checkout repository
20+
uses:actions/checkout@v5
21+
22+
-name:Load target matrix
23+
id:set-matrix
24+
run:echo "matrix=$(jq -c '.' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT
25+
26+
onboard:
27+
needs:load-targets
28+
runs-on:ubuntu-22.04
29+
strategy:
30+
fail-fast:false
31+
matrix:
32+
include:${{ fromJson(needs.load-targets.outputs.matrix) }}
33+
34+
steps:
35+
-name:Checkout repository
36+
uses:actions/checkout@v5
37+
with:
38+
fetch-depth:0
39+
40+
-name:Install packages
41+
run:${{ matrix.setup_cmd }}
42+
43+
-name:Setup ccache
44+
uses:hendrikmuhs/ccache-action@v1.2
45+
with:
46+
key:${{ matrix.port }}-${{ matrix.board }}
47+
48+
-name:Run Membrowse Onboard Action
49+
uses:membrowse/membrowse-action/onboard-action@main
50+
with:
51+
target_name:${{ matrix.target_name }}
52+
num_commits:${{ github.event.inputs.num_commits }}
53+
build_script:${{ matrix.build_cmd }}
54+
elf:${{ matrix.elf }}
55+
ld:${{ matrix.ld }}
56+
linker_vars:${{ matrix.linker_vars }}
57+
api_key:${{ secrets.MEMBROWSE_API_KEY }}
58+
api_url:${{ vars.MEMBROWSE_API_URL }}

‎.github/workflows/membrowse-pr.yml‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name:Membrowse Memory Report
2+
# Membrowse CI workflow for memory analysis
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
-master
9+
10+
concurrency:
11+
group:${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress:true
13+
14+
jobs:
15+
load-targets:
16+
runs-on:ubuntu-22.04
17+
outputs:
18+
matrix:${{ steps.set-matrix.outputs.matrix }}
19+
steps:
20+
-name:Checkout repository
21+
uses:actions/checkout@v5
22+
23+
-name:Load target matrix
24+
id:set-matrix
25+
run:echo "matrix=$(jq -c '.' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT
26+
27+
analyze:
28+
needs:load-targets
29+
runs-on:ubuntu-22.04
30+
strategy:
31+
fail-fast:false
32+
matrix:
33+
include:${{ fromJson(needs.load-targets.outputs.matrix) }}
34+
35+
steps:
36+
-name:Checkout repository
37+
uses:actions/checkout@v5
38+
with:
39+
fetch-depth:0
40+
41+
-name:Install packages
42+
run:${{ matrix.setup_cmd }}
43+
44+
-name:Setup ccache
45+
uses:hendrikmuhs/ccache-action@v1.2
46+
with:
47+
key:${{ matrix.port }}-${{ matrix.board }}
48+
49+
-name:Build firmware
50+
run:${{ matrix.build_cmd }}
51+
52+
-name:Run Membrowse PR Action
53+
id:analyze
54+
uses:membrowse/membrowse-action@main
55+
with:
56+
target_name:${{ matrix.target_name }}
57+
elf:${{ matrix.elf }}
58+
ld:${{ matrix.ld }}
59+
linker_vars:${{ matrix.linker_vars }}
60+
api_key:${{ secrets.MEMBROWSE_API_KEY }}
61+
api_url:${{ vars.MEMBROWSE_API_URL }}
62+
verbose:INFO
63+
64+
-name:Upload report artifact
65+
uses:actions/upload-artifact@v4
66+
with:
67+
name:membrowse-report-${{ matrix.target_name }}
68+
path:${{ steps.analyze.outputs.report_path }}

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Unix CI badge](https://github.com/micropython/micropython/actions/workflows/ports_unix.yml/badge.svg)](https://github.com/micropython/micropython/actions?query=branch%3Amaster+event%3Apush)[![STM32 CI badge](https://github.com/micropython/micropython/actions/workflows/ports_stm32.yml/badge.svg)](https://github.com/micropython/micropython/actions?query=branch%3Amaster+event%3Apush)[![Docs CI badge](https://github.com/micropython/micropython/actions/workflows/docs.yml/badge.svg)](https://docs.micropython.org/)[![codecov](https://codecov.io/gh/micropython/micropython/branch/master/graph/badge.svg?token=I92PfD05sD)](https://codecov.io/gh/micropython/micropython)
1+
[![Unix CI badge](https://github.com/micropython/micropython/actions/workflows/ports_unix.yml/badge.svg)](https://github.com/micropython/micropython/actions?query=branch%3Amaster+event%3Apush)[![STM32 CI badge](https://github.com/micropython/micropython/actions/workflows/ports_stm32.yml/badge.svg)](https://github.com/micropython/micropython/actions?query=branch%3Amaster+event%3Apush)[![Docs CI badge](https://github.com/micropython/micropython/actions/workflows/docs.yml/badge.svg)](https://docs.micropython.org/)[![codecov](https://codecov.io/gh/micropython/micropython/branch/master/graph/badge.svg?token=I92PfD05sD)](https://codecov.io/gh/micropython/micropython)[![membrowse](https://membrowse.com/badge.svg)](https://membrowse.com/public/micropython/micropython)
22

33
The MicroPython project
44
=======================

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp