diff --git a/.github/workflows/app_builder.yml b/.github/workflows/app_builder.yml new file mode 100644 index 0000000..727ea5f --- /dev/null +++ b/.github/workflows/app_builder.yml @@ -0,0 +1,91 @@ +# Copyright 2024 Khalil Estell +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 🏗️ Demo Builder + +on: + workflow_call: + inputs: + repo: + type: string + default: ${{ github.repository }} + version: + type: string + default: "" + conan_version: + type: string + default: "2.2.2" + compiler_profile_url: + type: string + required: true + compiler_profile: + type: string + required: true + compiler_profile_branch: + type: string + default: "main" + platform_profile_url: + type: string + required: true + platform_profile: + type: string + required: true + platform_profile_branch: + type: string + default: "main" + conan_build_dir: + type: string + default: "." + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4.1.1 + if: ${{ inputs.version != '' }} + with: + submodules: true + repository: ${{ inputs.repo }} + ref: ${{ inputs.version }} + + - uses: actions/checkout@v4.1.1 + if: ${{ inputs.version == '' }} + with: + submodules: true + repository: ${{ inputs.repo }} + + - name: 📥 Install Conan ${{ inputs.conan_version }} + run: pip3 install conan==${{ inputs.conan_version }} + + - name: 📡 Add `libhal` repo to conan remotes + run: conan remote add libhal + https://libhal.jfrog.io/artifactory/api/conan/trunk-conan + + - name: 📡 Create and setup default profile + run: conan profile detect --force + + - name: 👁️‍🗨️ Show conan profile + run: conan profile show + + - name: Install libhal settings_user.yml + run: conan config install -sf profiles/baremetal/v2 https://github.com/libhal/conan-config.git + + - name: Install compiler profiles + run: conan config install -tf profiles -sf conan/profiles --args "-b ${{ inputs.compiler_profile_branch }} --single-branch" ${{ inputs.compiler_profile_url }} + + - name: Install platform profiles + run: conan config install -tf profiles -sf conan/profiles --args "-b ${{ inputs.platform_profile_branch }} --single-branch" ${{ inputs.platform_profile_url }} + + - name: 🏗️ Build Application for ${{ inputs.profile }} + run: conan build ${{ inputs.conan_build_dir }} -pr ${{ inputs.compiler_profile }} -pr ${{ inputs.platform_profile }} diff --git a/.github/workflows/demo_builder.yml b/.github/workflows/demo_builder.yml index cf8eb3f..e4f816f 100644 --- a/.github/workflows/demo_builder.yml +++ b/.github/workflows/demo_builder.yml @@ -17,7 +17,7 @@ name: 🏗️ Demo Builder on: workflow_call: inputs: - library: + library: # this field is ignored but kept here for backwards compatible type: string default: ${{ github.event.repository.name }} repo: diff --git a/.github/workflows/self_check.yml b/.github/workflows/self_check.yml index 3b8742d..1edfc20 100644 --- a/.github/workflows/self_check.yml +++ b/.github/workflows/self_check.yml @@ -122,8 +122,8 @@ jobs: repo: libhal/libhal-lpc40 compiler_profile_url: https://github.com/libhal/arm-gnu-toolchain.git compiler_profile: v1/arm-gcc-12.3 - platform_profile_url: https://github.com/libhal/libhal-lpc40.git - platform_profile: v2/lpc4078 + platform_profile_url: https://github.com/libhal/libhal-arm-mcu.git + platform_profile: v1/lpc4078 secrets: inherit libhal-rmd-demos-lpc4078: @@ -133,8 +133,8 @@ jobs: repo: libhal/libhal-rmd compiler_profile_url: https://github.com/libhal/arm-gnu-toolchain.git compiler_profile: v1/arm-gcc-12.3 - platform_profile_url: https://github.com/libhal/libhal-lpc40.git - platform_profile: v2/lpc4078 + platform_profile_url: https://github.com/libhal/libhal-arm-mcu.git + platform_profile: v1/lpc4078 secrets: inherit libhal-rmd-demos-lpc4074: @@ -144,6 +144,36 @@ jobs: repo: libhal/libhal-rmd compiler_profile_url: https://github.com/libhal/arm-gnu-toolchain.git compiler_profile: v1/arm-gcc-12.3 - platform_profile_url: https://github.com/libhal/libhal-lpc40.git - platform_profile: v2/lpc4074 + platform_profile_url: https://github.com/libhal/libhal-arm-mcu.git + platform_profile: v1/lpc4074 + secrets: inherit + + libhal-starter-app-lpc4078: + uses: ./.github/workflows/app_builder.yml + with: + repo: libhal/libhal-starter + compiler_profile_url: https://github.com/libhal/arm-gnu-toolchain.git + compiler_profile: v1/arm-gcc-12.3 + platform_profile_url: https://github.com/libhal/libhal-arm-mcu.git + platform_profile: v1/lpc4078 + secrets: inherit + + libhal-starter-app-stm32f103c8: + uses: ./.github/workflows/app_builder.yml + with: + repo: libhal/libhal-starter + compiler_profile_url: https://github.com/libhal/arm-gnu-toolchain.git + compiler_profile: v1/arm-gcc-12.3 + platform_profile_url: https://github.com/libhal/libhal-arm-mcu.git + platform_profile: v1/stm32f103c8 + secrets: inherit + + libhal-starter-app-mod-stmt32f1-v4: + uses: ./.github/workflows/app_builder.yml + with: + repo: libhal/libhal-starter + compiler_profile_url: https://github.com/libhal/arm-gnu-toolchain.git + compiler_profile: v1/arm-gcc-12.3 + platform_profile_url: https://github.com/libhal/libhal-micromod.git + platform_profile: v1/mod-stm32f1-v4 secrets: inherit