Skip to content

Commit

Permalink
more ci enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed May 10, 2024
1 parent 0da2e47 commit 50c6275
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
16 changes: 16 additions & 0 deletions .github/actions/setup_toolchain/action.yml
Expand Up @@ -8,6 +8,11 @@ inputs:
required: false
type: string

outputs:
build_option:
description: 'Build option for the toolchain e.g --toolchain clang'
value: ${{ steps.set-toolchain-option.outputs.build_option }}

runs:
using: "composite"
steps:
Expand All @@ -29,3 +34,14 @@ runs:
uses: ./.github/actions/setup_toolchain/download
with:
toolchain_url: ${{ inputs.toolchain_url }}

- name: Set toolchain option
id: set-toolchain-option
run: |
BUILD_OPTION=""
if [[ "${{ inputs.toolchain }}" == *"clang"* ]]; then
BUILD_OPTION="--toolchain clang"
fi
echo "build_option=$BUILD_OPTION"
echo "build_option=$BUILD_OPTION" >> $GITHUB_OUTPUT
shell: bash
1 change: 1 addition & 0 deletions .github/workflows/build_cmake.yml
Expand Up @@ -113,6 +113,7 @@ jobs:
# Build Espressif
# ---------------------------------------
espressif:
if: false
uses: ./.github/workflows/build_util.yml
strategy:
fail-fast: false
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/build_util.yml
Expand Up @@ -37,6 +37,7 @@ jobs:
python-version: '3.x'

- name: Setup Toolchain
id: setup-toolchain
uses: ./.github/actions/setup_toolchain
with:
toolchain: ${{ inputs.toolchain }}
Expand All @@ -55,26 +56,15 @@ jobs:
run: |
sudo apt install -y ninja-build
- name: Set Build Option
run: |
BUILD_OPTION=""
if [[ "${{ inputs.toolchain }}" == *"clang"* ]]; then
BUILD_OPTION="--toolchain clang"
fi
echo "BUILD_OPTION=$BUILD_OPTION"
echo "BUILD_OPTION=$BUILD_OPTION" >> $GITHUB_ENV
shell: bash

- name: Get Dependencies
run: |
python3 tools/get_deps.py ${{ matrix.arg }}
echo "PICO_SDK_PATH=${{ github.workspace }}/pico-sdk" >> $GITHUB_ENV
- name: Build
if: inputs.toolchain != 'esp-idf'
run: |
python tools/build.py -s ${{ inputs.build-system }} $BUILD_OPTION ${{ matrix.arg }}
env:
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
python tools/build.py -s ${{ inputs.build-system }} ${{ setup-toolchain.outputs.build_option }} ${{ matrix.arg }}
- name: Build using ESP-IDF docker
if: inputs.toolchain == 'esp-idf'
Expand Down

0 comments on commit 50c6275

Please sign in to comment.