diff --git a/.github/workflows/demo_builder.yml b/.github/workflows/demo_builder.yml index 68a8eef..d7651f0 100644 --- a/.github/workflows/demo_builder.yml +++ b/.github/workflows/demo_builder.yml @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Profile Demo ๐Ÿ—๏ธ Builder +name: ๐Ÿ—๏ธ Demo Builder on: - workflow_dispatch: workflow_call: inputs: library: @@ -27,29 +26,25 @@ on: conan_version: type: string default: "2.0.14" - profile: - type: string - required: true - processor_profile: + compiler_version: type: string - default: "" + default: "12.2" platform_profile: type: string default: "" + profile: + type: string + required: true jobs: build: runs-on: ubuntu-22.04 - if: github.event.action != 'deleted' steps: - uses: actions/checkout@v3 with: submodules: true repository: ${{ inputs.repo }} - - name: ๐Ÿ“ฅ Install CMake 3.27.7 - run: pip3 install cmake==3.27.7 - - name: ๐Ÿ“ฅ Install Conan ${{ inputs.conan_version }} run: pip3 install conan==${{ inputs.conan_version }} @@ -71,21 +66,14 @@ jobs: run: conan remote login -p $API_KEY libhal $JFROG_USER - name: Install libhal settings_user.yml - run: conan config install -sf profiles/baremetal https://github.com/libhal/conan-config.git - - - name: Install host OS profiles - run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git - - - name: Install processor profiles - if: inputs.processor_profile != '' - run: conan config install -tf profiles -sf conan/profiles/ ${{ inputs.processor_profile }} + run: conan config install -sf profiles/baremetal/v2 https://github.com/libhal/conan-config.git - name: Install platform profiles if: inputs.platform_profile != '' run: conan config install -tf profiles -sf conan/profiles/ ${{ inputs.platform_profile }} - name: ๐Ÿ“ฆ Build package using ${{ inputs.profile }} - run: conan create . -pr ${{ inputs.profile }} -s build_type=MinSizeRel + run: conan create . -pr ${{ inputs.profile }} -s compiler.version=${{ inputs.compiler_version }} --version=latest - name: ๐Ÿ—๏ธ Build demos for ${{ inputs.profile }} - run: conan build demos -pr ${{ inputs.profile }} -s build_type=MinSizeRel + run: conan build demos -pr ${{ inputs.profile }} -s compiler.version=${{ inputs.compiler_version }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 31bd68f..e7e5200 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,67 +12,117 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Device ๐Ÿ—๏ธ Package ๐Ÿš€ Deploy - -# Builds packages for every device and architecture libhal supports +name: Package ๐Ÿ“ฆ + ๐Ÿš€ Deploy on: - workflow_dispatch: workflow_call: inputs: library: - default: ${{ github.event.repository.name }} type: string + default: ${{ github.event.repository.name }} repo: type: string default: ${{ github.repository }} conan_version: type: string default: "2.0.14" + compiler: + type: string + default: "gcc" + compiler_version: + type: string + default: "12.2" + version: + type: string + default: "" + compiler_package: + type: string + default: "" + arch: + type: string + required: true + os: + type: string + required: true jobs: - cortex-m0: - uses: ./.github/workflows/deploy_unit.yml - with: - library: ${{ inputs.library }} - repo: ${{ inputs.repo }} - conan_version: ${{ inputs.conan_version }} - profile: cortex-m0 - profile_source: https://github.com/libhal/libhal-armcortex.git - secrets: inherit - cortex-m1: - uses: ./.github/workflows/deploy_unit.yml - with: - library: ${{ inputs.library }} - repo: ${{ inputs.repo }} - conan_version: ${{ inputs.conan_version }} - profile: cortex-m1 - profile_source: https://github.com/libhal/libhal-armcortex.git - secrets: inherit - cortex-m3: - uses: ./.github/workflows/deploy_unit.yml - with: - library: ${{ inputs.library }} - repo: ${{ inputs.repo }} - conan_version: ${{ inputs.conan_version }} - profile: cortex-m3 - profile_source: https://github.com/libhal/libhal-armcortex.git - secrets: inherit - cortex-m4: - uses: ./.github/workflows/deploy_unit.yml - with: - library: ${{ inputs.library }} - repo: ${{ inputs.repo }} - conan_version: ${{ inputs.conan_version }} - profile: cortex-m4 - profile_source: https://github.com/libhal/libhal-armcortex.git - secrets: inherit - cortex-m4f: - uses: ./.github/workflows/deploy_unit.yml - with: - library: ${{ inputs.library }} - repo: ${{ inputs.repo }} - conan_version: ${{ inputs.conan_version }} - profile: cortex-m4f - profile_source: https://github.com/libhal/libhal-armcortex.git - secrets: inherit + deploy: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + if: ${{ inputs.version != '' }} + with: + submodules: true + repository: ${{ inputs.repo }} + ref: ${{ inputs.version }} + + - uses: actions/checkout@v3 + 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 linux default profiles + run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git + + - name: ๐Ÿ“ก Sign into JFrog Artifactory + env: + PASSWORD: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN }} + JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN_USER }} + run: conan remote login -p $PASSWORD libhal $JFROG_USER + + - name: ๐Ÿ“ก Install libhal settings_user.yml + run: conan config install -sf profiles/baremetal/v2 https://github.com/libhal/conan-config.git + + - name: Set Version Environment Variable + run: | + if [ -z "${{ inputs.version }}" ]; then + echo "VERSION=latest" >> $GITHUB_ENV + else + echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV + fi + + - name: Create `deploy.profile` + run: | + echo "[settings]" > deploy.profile + echo "arch=${{ inputs.arch }}" >> deploy.profile + echo "compiler=${{ inputs.compiler }}" >> deploy.profile + echo "compiler.version=${{ inputs.compiler_version }}" >> deploy.profile + echo "compiler.libcxx=libstdc++11" >> deploy.profile + echo "compiler.cppstd=20" >> deploy.profile + echo "os=${{ inputs.os }}" >> deploy.profile + + - name: Add compiler to `deploy.profile` [tool_requires] section + if: ${{ inputs.compiler_package != '' }} + run: | + echo "[tool_requires]" >> deploy.profile + echo "${{ inputs.compiler_package }}/${{ inputs.compiler_version }}" >> deploy.profile + + - name: ๐Ÿ“ฆ Create `Debug` package for ${{ inputs.profile }} + run: conan create . -s build_type=Debug -pr deploy.profile --version=${{ env.VERSION }} + + - name: ๐Ÿ“ฆ Create `RelWithDebInfo` package for ${{ inputs.profile }} + run: conan create . -s build_type=RelWithDebInfo -pr deploy.profile --version=${{ env.VERSION }} + + - name: ๐Ÿ“ฆ Create `MinSizeRel` package for ${{ inputs.profile }} + run: conan create . -s build_type=MinSizeRel -pr deploy.profile --version=${{ env.VERSION }} + + - name: ๐Ÿ“ฆ Create `Release` package for ${{ inputs.profile }} + run: conan create . -s build_type=Release -pr deploy.profile --version=${{ env.VERSION }} + + - name: ๐Ÿ†™ Upload package version ${{ inputs.version }} to `libhal` repo + if: ${{ inputs.version != '' }} + run: conan upload "${{ inputs.library }}/${{ inputs.version }}" --confirm -r=libhal diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml new file mode 100644 index 0000000..76f36b6 --- /dev/null +++ b/.github/workflows/deploy_all.yml @@ -0,0 +1,119 @@ +# Copyright 2023 Google LLC +# +# 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: ๐ŸŒ Package ๐Ÿ“ฆ + ๐Ÿš€ Deploy ๐ŸŒ + +# Builds packages for every device and architecture libhal supports + +on: + workflow_call: + inputs: + library: + type: string + default: ${{ github.event.repository.name }} + repo: + type: string + default: ${{ github.repository }} + conan_version: + type: string + default: "2.0.14" + compiler: + type: string + default: "gcc" + compiler_version: + type: string + default: "12.2" + version: + type: string + default: "" + +jobs: + cortex-m0: + uses: ./.github/workflows/deploy.yml + with: + library: ${{ inputs.library }} + repo: ${{ inputs.repo }} + conan_version: ${{ inputs.conan_version }} + compiler: ${{ inputs.compiler }} + compiler_version: ${{ inputs.compiler_version }} + compiler_package: arm-gnu-toolchain + version: ${{ inputs.version }} + arch: cortex-m0 + os: baremetal + secrets: inherit + cortex-m0plus: + uses: ./.github/workflows/deploy.yml + with: + library: ${{ inputs.library }} + repo: ${{ inputs.repo }} + conan_version: ${{ inputs.conan_version }} + compiler: ${{ inputs.compiler }} + compiler_version: ${{ inputs.compiler_version }} + compiler_package: arm-gnu-toolchain + version: ${{ inputs.version }} + arch: cortex-m0plus + os: baremetal + secrets: inherit + cortex-m1: + uses: ./.github/workflows/deploy.yml + with: + library: ${{ inputs.library }} + repo: ${{ inputs.repo }} + conan_version: ${{ inputs.conan_version }} + compiler: ${{ inputs.compiler }} + compiler_version: ${{ inputs.compiler_version }} + compiler_package: arm-gnu-toolchain + version: ${{ inputs.version }} + arch: cortex-m1 + os: baremetal + secrets: inherit + cortex-m3: + uses: ./.github/workflows/deploy.yml + with: + library: ${{ inputs.library }} + repo: ${{ inputs.repo }} + conan_version: ${{ inputs.conan_version }} + compiler: ${{ inputs.compiler }} + compiler_version: ${{ inputs.compiler_version }} + compiler_package: arm-gnu-toolchain + version: ${{ inputs.version }} + arch: cortex-m3 + os: baremetal + secrets: inherit + cortex-m4: + uses: ./.github/workflows/deploy.yml + with: + library: ${{ inputs.library }} + repo: ${{ inputs.repo }} + conan_version: ${{ inputs.conan_version }} + compiler: ${{ inputs.compiler }} + compiler_version: ${{ inputs.compiler_version }} + compiler_package: arm-gnu-toolchain + version: ${{ inputs.version }} + arch: cortex-m4 + os: baremetal + secrets: inherit + cortex-m4f: + uses: ./.github/workflows/deploy.yml + with: + library: ${{ inputs.library }} + repo: ${{ inputs.repo }} + conan_version: ${{ inputs.conan_version }} + compiler: ${{ inputs.compiler }} + compiler_version: ${{ inputs.compiler_version }} + compiler_package: arm-gnu-toolchain + version: ${{ inputs.version }} + arch: cortex-m4f + os: baremetal + secrets: inherit diff --git a/.github/workflows/deploy_unit.yml b/.github/workflows/deploy_unit.yml deleted file mode 100644 index 74fb01a..0000000 --- a/.github/workflows/deploy_unit.yml +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright 2023 Google LLC -# -# 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: Device ๐Ÿ“ฆ Package ๐Ÿš€ Deploy (unit) - -on: - workflow_dispatch: - workflow_call: - inputs: - library: - default: ${{ github.event.repository.name }} - type: string - repo: - type: string - default: ${{ github.repository }} - conan_version: - type: string - default: "2.0.14" - profile: - required: true - type: string - profile_source: - required: true - type: string - -jobs: - pull: - runs-on: ubuntu-22.04 - if: github.event.action == 'deleted' - steps: - - name: ๐Ÿ“ฅ Install CMake 3.27.7 - run: pip3 install cmake==3.27.7 - - - 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 linux default profiles - run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git - - - name: ๐Ÿ“ก Sign into JFrog Artifactory - env: - API_KEY: ${{ secrets.JFROG_LIBHAL_TRUNK_API_KEY }} - JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_USER }} - run: conan remote login -p $API_KEY libhal $JFROG_USER - - - name: ๐Ÿšฎ Pulling package version ${{ github.ref_name }} from `libhal` repo - run: conan remove "${{ inputs.library }}/${{ github.event.release.tag_name }}" --confirm -r=libhal - build: - runs-on: ubuntu-22.04 - if: github.event.action != 'deleted' - steps: - - uses: actions/checkout@v3 - with: - submodules: true - repository: ${{ inputs.repo }} - - - name: ๐Ÿ“ฅ Install CMake 3.27.7 - run: pip3 install cmake==3.27.7 - - - 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 linux default profiles - run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git - - - name: ๐Ÿ“ก Sign into JFrog Artifactory - if: ${{ github.ref == 'refs/heads/main' }} - env: - API_KEY: ${{ secrets.JFROG_LIBHAL_TRUNK_API_KEY }} - JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_USER }} - run: conan remote login -p $API_KEY libhal $JFROG_USER - - - name: ๐Ÿ“ก Install libhal settings_user.yml - run: conan config install -sf profiles/baremetal https://github.com/libhal/conan-config.git - - - name: ๐Ÿ“ก Install processor profiles - run: conan config install -tf profiles -sf conan/profiles/ ${{ inputs.profile_source }} - - - name: ๐Ÿ“ฆ Create `Debug` package for ${{ inputs.profile }} - run: conan create . -pr ${{ inputs.profile }} -s build_type=Debug -b missing - - - name: ๐Ÿ“ฆ Create `RelWithDebInfo` package for ${{ inputs.profile }} - run: conan create . -pr ${{ inputs.profile }} -s build_type=RelWithDebInfo -b missing - - - name: ๐Ÿ“ฆ Create `MinSizeRel` package for ${{ inputs.profile }} - run: conan create . -pr ${{ inputs.profile }} -s build_type=MinSizeRel -b missing - - - name: ๐Ÿ“ฆ Create `Release` package for ${{ inputs.profile }} - run: conan create . -pr ${{ inputs.profile }} -s build_type=Release -b missing - - - name: ๐Ÿ†™ Upload package version ${{ github.ref_name }} to `libhal` repo - if: startsWith(github.ref, 'refs/tags/') - run: conan upload "${{ inputs.library }}/${{ github.ref_name }}" --confirm -r=libhal diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ac340be..5a7122b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,18 +15,17 @@ name: ๐Ÿ“ docs on: - workflow_dispatch: workflow_call: inputs: library: - required: true type: string - source_dir: # Not used currently required: true + source_dir: # Not used currently type: string - repo: required: true + repo: type: string + required: true jobs: docs: diff --git a/.github/workflows/library.yml b/.github/workflows/library_check.yml similarity index 99% rename from .github/workflows/library.yml rename to .github/workflows/library_check.yml index 0a15a26..0367a51 100644 --- a/.github/workflows/library.yml +++ b/.github/workflows/library_check.yml @@ -15,24 +15,23 @@ name: โœ… checks on: - workflow_dispatch: workflow_call: inputs: library: - default: ${{ github.event.repository.name }} type: string + default: ${{ github.event.repository.name }} coverage: - default: true type: boolean + default: true fail_on_coverage: - default: false type: boolean + default: false coverage_threshold: - default: "40 80" type: string + default: "40 80" source_dir: - default: "include/" type: string + default: "include/" repo: type: string default: ${{ github.repository }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bd280a7..48926b4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,6 @@ name: ๐Ÿงผ lint on: - workflow_dispatch: workflow_call: inputs: library: diff --git a/.github/workflows/platform_deploy.yml b/.github/workflows/platform_deploy.yml deleted file mode 100644 index d01cf31..0000000 --- a/.github/workflows/platform_deploy.yml +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 2023 Google LLC -# -# 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: Platform ๐Ÿ“ฆ Package ๐Ÿš€ Deploy - -on: - workflow_dispatch: - workflow_call: - inputs: - library: - type: string - default: ${{ github.event.repository.name }} - repo: - type: string - default: ${{ github.repository }} - conan_version: - type: string - default: "2.0.14" - profile: - type: string - required: true - upload: - type: boolean - default: false - processor_profile: - type: string - default: "" - -jobs: - build: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - with: - submodules: true - repository: ${{ inputs.repo }} - - - name: ๐Ÿ“ฅ Install CMake 3.27.7 - run: pip3 install cmake==3.27.7 - - - 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: ๐Ÿ“ก Sign into JFrog Artifactory - if: ${{ github.ref == 'refs/heads/main' }} - env: - API_KEY: ${{ secrets.JFROG_LIBHAL_TRUNK_API_KEY }} - JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_USER }} - run: conan remote login -p $API_KEY libhal $JFROG_USER - - - name: Install libhal settings_user.yml - run: conan config install -sf profiles/baremetal https://github.com/libhal/conan-config.git - - - name: Install host OS profiles - run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git - - - name: Install processor profiles - if: inputs.processor_profile != '' - run: conan config install -tf profiles -sf conan/profiles/ ${{ inputs.processor_profile }} - - - name: Install platform profiles - run: conan config install -tf profiles conan/profiles/ - - - name: ๐Ÿ“ฆ Create `Debug` package for ${{ inputs.profile }} - run: conan create . -pr ${{ inputs.profile }} -s build_type=Debug -b missing - - - name: ๐Ÿ“ฆ Create `RelWithDebInfo` package for ${{ inputs.profile }} - run: conan create . -pr ${{ inputs.profile }} -s build_type=RelWithDebInfo -b missing - - - name: ๐Ÿ“ฆ Create `MinSizeRel` package for ${{ inputs.profile }} - run: conan create . -pr ${{ inputs.profile }} -s build_type=MinSizeRel -b missing - - - name: ๐Ÿ“ฆ Create `Release` package for ${{ inputs.profile }} - run: conan create . -pr ${{ inputs.profile }} -s build_type=Release -b missing - - - name: Check if `demos/` directory existence - id: check_demos_dir - uses: andstor/file-existence-action@v1 - with: - files: "demos/" - - - name: ๐Ÿ—๏ธ Build demos for ${{ inputs.profile }} - if: steps.check_demos_dir.outputs.files_exists == 'true' - run: conan build demos -pr ${{ inputs.profile }} -s build_type=MinSizeRel - - - name: ๐Ÿ†™ Upload package to `libhal` repo - if: startsWith(github.ref, 'refs/tags/') && inputs.upload - run: conan upload "${{ inputs.library }}/${{ github.ref_name }}" --confirm -r=libhal diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 94f96c8..26fa737 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,7 +15,6 @@ name: ๐Ÿš€ publish on: - workflow_dispatch: workflow_call: inputs: library: diff --git a/.github/workflows/self_check.yml b/.github/workflows/self_check.yml index 729cab5..8b866e8 100644 --- a/.github/workflows/self_check.yml +++ b/.github/workflows/self_check.yml @@ -15,7 +15,6 @@ name: โœ… CI on: - workflow_dispatch: pull_request: push: branches: @@ -25,68 +24,69 @@ on: jobs: libhal: - uses: ./.github/workflows/library.yml + uses: ./.github/workflows/library_check.yml with: library: libhal repo: libhal/libhal secrets: inherit libhal-armcortex: - uses: ./.github/workflows/library.yml + uses: ./.github/workflows/library_check.yml with: library: libhal-armcortex repo: libhal/libhal-armcortex secrets: inherit libhal-util: - uses: ./.github/workflows/library.yml + uses: ./.github/workflows/library_check.yml with: library: libhal-util repo: libhal/libhal-util secrets: inherit libhal-lpc40: - uses: ./.github/workflows/library.yml + uses: ./.github/workflows/library_check.yml with: library: libhal-lpc40 repo: libhal/libhal-lpc40 secrets: inherit libhal-soft: - uses: ./.github/workflows/library.yml + uses: ./.github/workflows/library_check.yml with: library: libhal-soft repo: libhal/libhal-soft secrets: inherit libhal-lpc4072: - uses: ./.github/workflows/platform_deploy.yml + uses: ./.github/workflows/deploy.yml with: library: libhal-lpc40 repo: libhal/libhal-lpc40 - profile: lpc4072 - processor_profile: https://github.com/libhal/libhal-armcortex.git + arch: cortex-m4f + os: baremetal secrets: inherit libhal-lpc4088: - uses: ./.github/workflows/platform_deploy.yml + uses: ./.github/workflows/deploy.yml with: library: libhal-lpc40 repo: libhal/libhal-lpc40 - profile: lpc4088 - processor_profile: https://github.com/libhal/libhal-armcortex.git + arch: cortex-m4f + os: baremetal secrets: inherit libhal-cortex-m0: - uses: ./.github/workflows/platform_deploy.yml + uses: ./.github/workflows/deploy.yml with: library: libhal-armcortex repo: libhal/libhal-armcortex - profile: cortex-m0 + arch: cortex-m0 + os: baremetal secrets: inherit libhal-soft-package: - uses: ./.github/workflows/deploy.yml + uses: ./.github/workflows/deploy_all.yml with: library: libhal-soft repo: libhal/libhal-soft @@ -98,7 +98,6 @@ jobs: library: libhal-rmd repo: libhal/libhal-rmd profile: lpc4078 - processor_profile: https://github.com/libhal/libhal-armcortex.git platform_profile: https://github.com/libhal/libhal-lpc40.git secrets: inherit @@ -108,6 +107,5 @@ jobs: library: libhal-rmd repo: libhal/libhal-rmd profile: lpc4074 - processor_profile: https://github.com/libhal/libhal-armcortex.git platform_profile: https://github.com/libhal/libhal-lpc40.git secrets: inherit diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 66a7889..fb7c75e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,6 @@ name: ๐Ÿงช tests on: - workflow_dispatch: workflow_call: inputs: library: @@ -38,40 +37,7 @@ on: type: string jobs: - pull: - runs-on: ubuntu-22.04 - if: github.event.action == 'deleted' - steps: - - name: ๐Ÿ“ฅ Install CMake 3.27.7 - run: pip3 install cmake==3.27.7 - - - 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 linux default profiles - run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git - - - name: ๐Ÿ“ก Sign into JFrog Artifactory - env: - API_KEY: ${{ secrets.JFROG_LIBHAL_TRUNK_API_KEY }} - JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_USER }} - run: conan remote login -p $API_KEY libhal $JFROG_USER - - - name: ๐Ÿšฎ Pulling package version ${{ github.event.release.tag_name }} from `libhal` repo - run: conan remove "${{ inputs.library }}/${{ github.event.release.tag_name }}" --confirm -r=libhal - run_tests: - if: github.event.action != 'deleted' strategy: fail-fast: false matrix: @@ -109,9 +75,6 @@ jobs: if: ${{ matrix.installations != '' }} run: ${{ matrix.installations }} - - name: ๐Ÿ“ฅ Install CMake 3.27.7 - run: pip3 install cmake==3.27.7 - - name: ๐Ÿ“ฅ Install Conan ${{ inputs.conan_version }} run: pip3 install conan==${{ inputs.conan_version }} @@ -130,17 +93,17 @@ jobs: - name: ๐Ÿ”ฌ Create & Run Unit Tests if: ${{ runner.os != 'Windows' }} - run: VERBOSE=1 conan create . --build=missing -s compiler.cppstd=20 -s compiler.version=${{ matrix.compiler_version }} -s compiler.libcxx=${{ matrix.standard_library }} -s compiler=${{ matrix.toolchain }} -s build_type=Debug + run: VERBOSE=1 conan create . --build=missing -s compiler.cppstd=20 -s compiler.version=${{ matrix.compiler_version }} -s compiler.libcxx=${{ matrix.standard_library }} -s compiler=${{ matrix.toolchain }} -s build_type=Debug --version="latest" - name: ๐Ÿ”ฌ Create & Run Unit Tests if: ${{ runner.os == 'Windows' }} - run: $env:VERBOSE = 1 ; conan create . --build=missing -s compiler.cppstd=20 -s compiler.version=${{ matrix.compiler_version }} -s compiler.libcxx=${{ matrix.standard_library }} -s compiler=${{ matrix.toolchain }} -s build_type=Debug + run: $env:VERBOSE = 1 ; conan create . --build=missing -s compiler.cppstd=20 -s compiler.version=${{ matrix.compiler_version }} -s compiler.libcxx=${{ matrix.standard_library }} -s compiler=${{ matrix.toolchain }} -s build_type=Debug --version="latest" - name: ๐Ÿ”ฌ Build & Run Unit Tests (for coverage) if: ${{ matrix.enable_coverage }} - run: conan build . --build=missing -s compiler.cppstd=20 -s compiler.version=${{ matrix.compiler_version }} -s compiler.libcxx=${{ matrix.standard_library }} -s compiler=${{ matrix.toolchain }} -s build_type=Debug + run: conan build . --build=missing -s compiler.cppstd=20 -s compiler.version=${{ matrix.compiler_version }} -s compiler.libcxx=${{ matrix.standard_library }} -s compiler=${{ matrix.toolchain }} -s build_type=Debug --version="latest" - - name: ๐Ÿ“ฅ Install GCovr + - name: ๐Ÿ“ฅ Install gcovr if: ${{ matrix.enable_coverage }} run: pip3 install gcovr diff --git a/README.md b/README.md index 3611a87..52bf162 100644 --- a/README.md +++ b/README.md @@ -262,7 +262,7 @@ Inputs: package. Default is an empty string. This workflow runs on an Ubuntu 22.04 runner. It checks out the code for the -library, installs CMake and Conan, adds the `libhal` Conan repository to the +library, installs Conan, adds the `libhal` Conan repository to the Conan remotes, creates and sets up the default Conan profile, signs into JFrog Artifactory if the workflow is running on the `main` branch, installs the libhal settings_user.yml file, installs host OS profiles, installs processor profiles @@ -297,7 +297,7 @@ Inputs: demo. Default is an empty string. This workflow runs on an Ubuntu 22.04 runner. It checks out the code for the -library, installs CMake and Conan, adds the `libhal` Conan repository to the +library, installs Conan, adds the `libhal` Conan repository to the Conan remotes, creates and sets up the default Conan profile, signs into JFrog Artifactory if the workflow is running on the `main` branch, installs the libhal settings_user.yml file, installs host OS profiles, installs processor profiles