summaryrefslogtreecommitdiff
path: root/.github/workflows/membrowse-onboard.yml
blob: 4b9e54cff104cae6ca5b55ca4900794fbd692f77 (plain)
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
name: Onboard to Membrowse

on:
  workflow_dispatch:
    inputs:
      num_commits:
        description: 'Number of commits to process'
        required: true
        default: '10'
        type: string

jobs:
  load-targets:
    runs-on: ubuntu-22.04
    outputs:
      targets: ${{ steps.load.outputs.targets }}
      toolchains: ${{ steps.load.outputs.toolchains }}
    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
          echo "toolchains=$(jq -c '.toolchains' .github/membrowse-targets.json)" >> $GITHUB_OUTPUT

  onboard:
    needs: load-targets
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        include: ${{ fromJson(needs.load-targets.outputs.targets) }}

    steps:
      - name: Checkout repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 0
          submodules: recursive

      - name: Install packages
        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
        with:
          key: ${{ matrix.port }}-${{ matrix.board }}

      - name: Run Membrowse Onboard Action
        uses: membrowse/membrowse-action/onboard-action@v1
        with:
          target_name: ${{ matrix.port }}-${{ matrix.board }}-${{ matrix.example }}
          num_commits: ${{ github.event.inputs.num_commits }}
          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 || '' }}
          api_key: ${{ secrets.MEMBROWSE_API_KEY }}
          api_url: ${{ vars.MEMBROWSE_API_URL }}