Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 30 additions & 27 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 @@ -24,31 +23,47 @@ on:
repo:
type: string
default: ${{ github.repository }}
version:
type: string
default: ""
conan_version:
type: string
default: "2.0.14"
profile:
compiler_profile_url:
type: string
required: true
processor_profile:
compiler_profile:
type: string
default: ""
required: true
compiler_profile_branch:
type: string
default: "main"
platform_profile_url:
type: string
required: true
platform_profile:
type: string
default: ""
required: true
platform_profile_branch:
type: string
default: "main"

jobs:
build:
runs-on: ubuntu-22.04
if: github.event.action != 'deleted'
steps:
- uses: actions/checkout@v3
if: ${{ inputs.version != '' }}
with:
submodules: true
repository: ${{ inputs.repo }}
ref: ${{ inputs.version }}

- name: 📥 Install CMake 3.27.7
run: pip3 install cmake==3.27.7
- 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 }}
Expand All @@ -63,29 +78,17 @@ jobs:
- 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
run: conan config install -sf profiles/baremetal/v2 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 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
if: inputs.platform_profile != ''
run: conan config install -tf profiles -sf conan/profiles/ ${{ inputs.platform_profile }}
run: conan config install -tf profiles -sf conan/profiles --args "-b ${{ inputs.platform_profile_branch }} --single-branch" ${{ inputs.platform_profile_url }}

- name: 📦 Build package using ${{ inputs.profile }}
run: conan create . -pr ${{ inputs.profile }} -s build_type=MinSizeRel
run: conan create . -pr ${{ inputs.compiler_profile }} -pr ${{ inputs.platform_profile }} --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.compiler_profile }} -pr ${{ inputs.platform_profile }}
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"
version:
type: string
default: ""
compiler:
type: string
required: true
compiler_version:
type: string
required: true
compiler_package:
type: string
required: true
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
113 changes: 113 additions & 0 deletions .github/workflows/deploy_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# 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 }}
version:
type: string
default: ""
conan_version:
type: string
default: "2.0.14"

jobs:
cortex-m0:
uses: ./.github/workflows/deploy.yml
with:
library: ${{ inputs.library }}
repo: ${{ inputs.repo }}
version: ${{ inputs.version }}
conan_version: ${{ inputs.conan_version }}
compiler: gcc
compiler_version: 12.3
compiler_package: arm-gnu-toolchain
arch: cortex-m0
os: baremetal
secrets: inherit
cortex-m0plus:
uses: ./.github/workflows/deploy.yml
with:
library: ${{ inputs.library }}
repo: ${{ inputs.repo }}
version: ${{ inputs.version }}
conan_version: ${{ inputs.conan_version }}
compiler: gcc
compiler_version: 12.3
compiler_package: arm-gnu-toolchain
arch: cortex-m0plus
os: baremetal
secrets: inherit
cortex-m1:
uses: ./.github/workflows/deploy.yml
with:
library: ${{ inputs.library }}
repo: ${{ inputs.repo }}
version: ${{ inputs.version }}
conan_version: ${{ inputs.conan_version }}
compiler: gcc
compiler_version: 12.3
compiler_package: arm-gnu-toolchain
arch: cortex-m1
os: baremetal
secrets: inherit
cortex-m3:
uses: ./.github/workflows/deploy.yml
with:
library: ${{ inputs.library }}
repo: ${{ inputs.repo }}
version: ${{ inputs.version }}
conan_version: ${{ inputs.conan_version }}
compiler: gcc
compiler_version: 12.3
compiler_package: arm-gnu-toolchain
arch: cortex-m3
os: baremetal
secrets: inherit
cortex-m4:
uses: ./.github/workflows/deploy.yml
with:
library: ${{ inputs.library }}
repo: ${{ inputs.repo }}
version: ${{ inputs.version }}
conan_version: ${{ inputs.conan_version }}
compiler: gcc
compiler_version: 12.3
compiler_package: arm-gnu-toolchain
arch: cortex-m4
os: baremetal
secrets: inherit
cortex-m4f:
uses: ./.github/workflows/deploy.yml
with:
library: ${{ inputs.library }}
repo: ${{ inputs.repo }}
version: ${{ inputs.version }}
conan_version: ${{ inputs.conan_version }}
compiler: gcc
compiler_version: 12.3
compiler_package: arm-gnu-toolchain
arch: cortex-m4f
os: baremetal
secrets: inherit
Loading