From 8f8a0e5b583423a8f35be9dd400567a9ade8a6ca Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 10 May 2024 16:15:36 +0700 Subject: [PATCH] add get_deps action --- .../{prepare_build => get_deps}/action.yml | 22 +++++++++---------- .github/workflows/build_util.yml | 17 +------------- 2 files changed, 12 insertions(+), 27 deletions(-) rename .github/actions/{prepare_build => get_deps}/action.yml (51%) diff --git a/.github/actions/prepare_build/action.yml b/.github/actions/get_deps/action.yml similarity index 51% rename from .github/actions/prepare_build/action.yml rename to .github/actions/get_deps/action.yml index 11717ec490..38b44a70e5 100644 --- a/.github/actions/prepare_build/action.yml +++ b/.github/actions/get_deps/action.yml @@ -1,29 +1,29 @@ -name: Prepare to build +name: Get dependencies inputs: - family: + arg: required: true type: string runs: using: "composite" steps: - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Checkout pico-sdk for rp2040 - if: contains(inputs.family, 'rp2040') + if: contains(inputs.arg, 'rp2040') || contains(inputs.arg, 'raspberry_pi_pico') uses: actions/checkout@v4 with: repository: raspberrypi/pico-sdk ref: develop path: pico-sdk - - name: Get Dependencies + - name: Linux dependencies + if: runner.os == 'Linux' run: | sudo apt install -y ninja-build - python3 tools/get_deps.py ${{ inputs.family }} - echo >> $GITHUB_ENV "PICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk" + shell: bash + + - name: Get Dependencies + run: | + python3 tools/get_deps.py ${{ inputs.arg }} + echo "PICO_SDK_PATH=${{ github.workspace }}/pico-sdk" >> $GITHUB_ENV shell: bash diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml index 8eae41a48c..db2784f3f0 100644 --- a/.github/workflows/build_util.yml +++ b/.github/workflows/build_util.yml @@ -43,23 +43,8 @@ jobs: toolchain: ${{ inputs.toolchain }} toolchain_url: ${{ inputs.toolchain_url }} - - name: Checkout pico-sdk for rp2040 - if: contains(matrix.arg, 'rp2040') || contains(matrix.arg, 'raspberry_pi_pico') - uses: actions/checkout@v4 - with: - repository: raspberrypi/pico-sdk - ref: develop - path: pico-sdk - - - name: Linux dependencies - if: runner.os == 'Linux' - run: | - sudo apt install -y ninja-build - - name: Get Dependencies - run: | - python3 tools/get_deps.py ${{ matrix.arg }} - echo "PICO_SDK_PATH=${{ github.workspace }}/pico-sdk" >> $GITHUB_ENV + uses: ./.github/actions/get_deps - name: Build if: inputs.toolchain != 'esp-idf'