restructure targets file

This commit is contained in:
Michael Rogov Papernov
2026-01-24 13:06:56 +00:00
parent 5ad42064ea
commit 697fdca69d
6 changed files with 523 additions and 697 deletions

File diff suppressed because it is too large Load Diff

View File

@ -386,10 +386,6 @@ jobs:
merge-multiple: true
continue-on-error: true
- name: Save PR number
if: steps.download.outcome == 'success'
run: echo ${{ github.event.number }} > reports/pr_number.txt
- name: Upload Membrowse Comment Artifact
if: steps.download.outcome == 'success'
uses: actions/upload-artifact@v5

View File

@ -78,7 +78,7 @@ jobs:
run: |
for dir in cmake-build/cmake-build-*; do
board=$(basename "$dir" | sed 's/cmake-build-//')
ld_path=$(jq -r --arg b "$board" '.[] | select(.board == $b) | .ld // empty' .github/membrowse-targets.json)
ld_path=$(jq -r --arg b "$board" '.targets[] | select(.board == $b) | .ld // empty' .github/membrowse-targets.json)
if [ -n "$ld_path" ] && [ -f "$ld_path" ]; then
mkdir -p "cmake-build/$(dirname "$ld_path")"
cp "$ld_path" "cmake-build/$ld_path"

View File

@ -11,11 +11,14 @@ jobs:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
github.event.workflow_run.conclusion != 'cancelled'
permissions:
actions: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Download Artifacts
id: download
uses: actions/download-artifact@v5
@ -26,19 +29,10 @@ jobs:
path: reports
continue-on-error: true
- name: Read PR Number
if: steps.download.outcome == 'success'
id: pr_number
run: |
if [ -f reports/pr_number.txt ]; then
echo "number=$(cat reports/pr_number.txt)" >> $GITHUB_OUTPUT
fi
- name: Post Membrowse PR comment
if: steps.download.outcome == 'success' && steps.pr_number.outputs.number != ''
if: steps.download.outcome == 'success'
uses: membrowse/membrowse-action/comment-action@v1
with:
json_files: 'reports/*.json'
pr_number: ${{ steps.pr_number.outputs.number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -13,14 +13,17 @@ jobs:
load-targets:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
targets: ${{ steps.load.outputs.targets }}
toolchains: ${{ steps.load.outputs.toolchains }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Load target matrix
id: set-matrix
run: echo "matrix=$(jq -c '.' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT
id: load
run: |
echo "targets=$(jq -c '.targets' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT
echo "toolchains=$(jq -c '.toolchains' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT
onboard:
needs: load-targets
@ -28,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.load-targets.outputs.matrix) }}
include: ${{ fromJson(needs.load-targets.outputs.targets) }}
steps:
- name: Checkout repository
@ -38,7 +41,8 @@ jobs:
submodules: recursive
- name: Install packages
run: ${{ matrix.setup_cmd }}
run: |
${{ 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/ccache-action@v1.2
@ -48,11 +52,11 @@ jobs:
- name: Run Membrowse Onboard Action
uses: membrowse/membrowse-action/onboard-action@v1
with:
target_name: ${{ matrix.target_name }}
target_name: ${{ matrix.port }}-${{ matrix.board }}-${{ matrix.example }}
num_commits: ${{ github.event.inputs.num_commits }}
build_script: ${{ matrix.build_cmd }}
elf: ${{ matrix.elf }}
build_script: python3 tools/build.py -s cmake -b ${{ matrix.board }}
elf: cmake-build/cmake-build-${{ matrix.board }}/device/${{ matrix.example }}/${{ matrix.example }}.elf
ld: ${{ matrix.ld }}
linker_vars: ${{ matrix.linker_vars }}
linker_vars: ${{ matrix.linker_vars || '' }}
api_key: ${{ secrets.MEMBROWSE_API_KEY }}
api_url: ${{ vars.MEMBROWSE_API_URL }}

View File

@ -16,14 +16,14 @@ jobs:
load-targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
targets: ${{ steps.load.outputs.targets }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Load target matrix
id: set-matrix
run: echo "matrix=$(jq -c '.' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT
id: load
run: echo "targets=$(jq -c '.targets' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT
analyze:
needs: [load-targets]
@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.load-targets.outputs.matrix) }}
include: ${{ fromJson(needs.load-targets.outputs.targets) }}
steps:
- name: Checkout repository
@ -58,7 +58,7 @@ jobs:
- name: Check if ELF exists
id: check-elf
run: |
if [ -f "${{ matrix.elf }}" ]; then
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
@ -71,10 +71,10 @@ jobs:
continue-on-error: true
uses: membrowse/membrowse-action@v1
with:
target_name: ${{ matrix.target_name }}
elf: ${{ matrix.elf }}
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 }}
linker_vars: ${{ matrix.linker_vars || '' }}
api_key: ${{ secrets.MEMBROWSE_API_KEY }}
api_url: ${{ vars.MEMBROWSE_API_URL }}
verbose: INFO
@ -87,7 +87,7 @@ jobs:
continue-on-error: true
uses: membrowse/membrowse-action@v1
with:
target_name: ${{ matrix.target_name }}
target_name: ${{ matrix.port }}-${{ matrix.board }}-${{ matrix.example }}
identical: true
api_key: ${{ secrets.MEMBROWSE_API_KEY }}
api_url: ${{ vars.MEMBROWSE_API_URL }}
@ -97,5 +97,5 @@ jobs:
if: steps.membrowse.outcome == 'success' || steps.membrowse-identical.outcome == 'success'
uses: actions/upload-artifact@v5
with:
name: membrowse-report-${{ matrix.target_name }}
name: membrowse-report-${{ matrix.port }}-${{ matrix.board }}-${{ matrix.example }}
path: ${{ steps.membrowse.outputs.report_path || steps.membrowse-identical.outputs.report_path }}