Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
💥 Introducing CI version 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Khalil Estell committed Dec 13, 2023
1 parent 91e1795 commit 737550b
Show file tree
Hide file tree
Showing 12 changed files with 257 additions and 376 deletions.
30 changes: 9 additions & 21 deletions .github/workflows/demo_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}

Expand All @@ -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 }}
150 changes: 100 additions & 50 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
119 changes: 119 additions & 0 deletions .github/workflows/deploy_all.yml
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 737550b

Please sign in to comment.