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

Commit 0d4b9ab

Browse files
author
Khalil Estell
committed
💥 Introducing CI version 5.0.0
1 parent 91e1795 commit 0d4b9ab

File tree

12 files changed

+352
-405
lines changed

12 files changed

+352
-405
lines changed

.github/workflows/demo_builder.yml

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Profile Demo 🏗️ Builder
15+
name: 🏗️ Demo Builder
1616

1717
on:
18-
workflow_dispatch:
1918
workflow_call:
2019
inputs:
2120
library:
@@ -24,31 +23,47 @@ on:
2423
repo:
2524
type: string
2625
default: ${{ github.repository }}
26+
version:
27+
type: string
28+
default: ""
2729
conan_version:
2830
type: string
2931
default: "2.0.14"
30-
profile:
32+
compiler_profile_url:
3133
type: string
3234
required: true
33-
processor_profile:
35+
compiler_profile:
3436
type: string
35-
default: ""
37+
required: true
38+
compiler_profile_branch:
39+
type: string
40+
default: "main"
41+
platform_profile_url:
42+
type: string
43+
required: true
3644
platform_profile:
3745
type: string
38-
default: ""
46+
required: true
47+
platform_profile_branch:
48+
type: string
49+
default: "main"
3950

4051
jobs:
4152
build:
4253
runs-on: ubuntu-22.04
43-
if: github.event.action != 'deleted'
4454
steps:
4555
- uses: actions/checkout@v3
56+
if: ${{ inputs.version != '' }}
4657
with:
4758
submodules: true
4859
repository: ${{ inputs.repo }}
60+
ref: ${{ inputs.version }}
4961

50-
- name: 📥 Install CMake 3.27.7
51-
run: pip3 install cmake==3.27.7
62+
- uses: actions/checkout@v3
63+
if: ${{ inputs.version == '' }}
64+
with:
65+
submodules: true
66+
repository: ${{ inputs.repo }}
5267

5368
- name: 📥 Install Conan ${{ inputs.conan_version }}
5469
run: pip3 install conan==${{ inputs.conan_version }}
@@ -63,29 +78,17 @@ jobs:
6378
- name: 👁️‍🗨️ Show conan profile
6479
run: conan profile show
6580

66-
- name: 📡 Sign into JFrog Artifactory
67-
if: ${{ github.ref == 'refs/heads/main' }}
68-
env:
69-
API_KEY: ${{ secrets.JFROG_LIBHAL_TRUNK_API_KEY }}
70-
JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_USER }}
71-
run: conan remote login -p $API_KEY libhal $JFROG_USER
72-
7381
- name: Install libhal settings_user.yml
74-
run: conan config install -sf profiles/baremetal https://github.com/libhal/conan-config.git
75-
76-
- name: Install host OS profiles
77-
run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git
82+
run: conan config install -sf profiles/baremetal/v2 https://github.com/libhal/conan-config.git
7883

79-
- name: Install processor profiles
80-
if: inputs.processor_profile != ''
81-
run: conan config install -tf profiles -sf conan/profiles/ ${{ inputs.processor_profile }}
84+
- name: Install compiler profiles
85+
run: conan config install -tf profiles -sf conan/profiles --args "-b ${{ inputs.compiler_profile_branch }} --single-branch" ${{ inputs.compiler_profile_url }}
8286

8387
- name: Install platform profiles
84-
if: inputs.platform_profile != ''
85-
run: conan config install -tf profiles -sf conan/profiles/ ${{ inputs.platform_profile }}
88+
run: conan config install -tf profiles -sf conan/profiles --args "-b ${{ inputs.platform_profile_branch }} --single-branch" ${{ inputs.platform_profile_url }}
8689

8790
- name: 📦 Build package using ${{ inputs.profile }}
88-
run: conan create . -pr ${{ inputs.profile }} -s build_type=MinSizeRel
91+
run: conan create . -pr ${{ inputs.compiler_profile }} -pr ${{ inputs.platform_profile }} --version=latest
8992

9093
- name: 🏗️ Build demos for ${{ inputs.profile }}
91-
run: conan build demos -pr ${{ inputs.profile }} -s build_type=MinSizeRel
94+
run: conan build demos -pr ${{ inputs.compiler_profile }} -pr ${{ inputs.platform_profile }}

.github/workflows/deploy.yml

Lines changed: 100 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,67 +12,117 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Device 🏗️ Package 🚀 Deploy
16-
17-
# Builds packages for every device and architecture libhal supports
15+
name: Package 📦 + 🚀 Deploy
1816

1917
on:
20-
workflow_dispatch:
2118
workflow_call:
2219
inputs:
2320
library:
24-
default: ${{ github.event.repository.name }}
2521
type: string
22+
default: ${{ github.event.repository.name }}
2623
repo:
2724
type: string
2825
default: ${{ github.repository }}
2926
conan_version:
3027
type: string
3128
default: "2.0.14"
29+
version:
30+
type: string
31+
default: ""
32+
compiler:
33+
type: string
34+
required: true
35+
compiler_version:
36+
type: string
37+
required: true
38+
compiler_package:
39+
type: string
40+
required: true
41+
arch:
42+
type: string
43+
required: true
44+
os:
45+
type: string
46+
required: true
3247

3348
jobs:
34-
cortex-m0:
35-
uses: ./.github/workflows/deploy_unit.yml
36-
with:
37-
library: ${{ inputs.library }}
38-
repo: ${{ inputs.repo }}
39-
conan_version: ${{ inputs.conan_version }}
40-
profile: cortex-m0
41-
profile_source: https://github.com/libhal/libhal-armcortex.git
42-
secrets: inherit
43-
cortex-m1:
44-
uses: ./.github/workflows/deploy_unit.yml
45-
with:
46-
library: ${{ inputs.library }}
47-
repo: ${{ inputs.repo }}
48-
conan_version: ${{ inputs.conan_version }}
49-
profile: cortex-m1
50-
profile_source: https://github.com/libhal/libhal-armcortex.git
51-
secrets: inherit
52-
cortex-m3:
53-
uses: ./.github/workflows/deploy_unit.yml
54-
with:
55-
library: ${{ inputs.library }}
56-
repo: ${{ inputs.repo }}
57-
conan_version: ${{ inputs.conan_version }}
58-
profile: cortex-m3
59-
profile_source: https://github.com/libhal/libhal-armcortex.git
60-
secrets: inherit
61-
cortex-m4:
62-
uses: ./.github/workflows/deploy_unit.yml
63-
with:
64-
library: ${{ inputs.library }}
65-
repo: ${{ inputs.repo }}
66-
conan_version: ${{ inputs.conan_version }}
67-
profile: cortex-m4
68-
profile_source: https://github.com/libhal/libhal-armcortex.git
69-
secrets: inherit
70-
cortex-m4f:
71-
uses: ./.github/workflows/deploy_unit.yml
72-
with:
73-
library: ${{ inputs.library }}
74-
repo: ${{ inputs.repo }}
75-
conan_version: ${{ inputs.conan_version }}
76-
profile: cortex-m4f
77-
profile_source: https://github.com/libhal/libhal-armcortex.git
78-
secrets: inherit
49+
deploy:
50+
runs-on: ubuntu-22.04
51+
steps:
52+
- uses: actions/checkout@v3
53+
if: ${{ inputs.version != '' }}
54+
with:
55+
submodules: true
56+
repository: ${{ inputs.repo }}
57+
ref: ${{ inputs.version }}
58+
59+
- uses: actions/checkout@v3
60+
if: ${{ inputs.version == '' }}
61+
with:
62+
submodules: true
63+
repository: ${{ inputs.repo }}
64+
65+
- name: 📥 Install Conan ${{ inputs.conan_version }}
66+
run: pip3 install conan==${{ inputs.conan_version }}
67+
68+
- name: 📡 Add `libhal` repo to conan remotes
69+
run: conan remote add libhal
70+
https://libhal.jfrog.io/artifactory/api/conan/trunk-conan
71+
72+
- name: 📡 Create and setup default profile
73+
run: conan profile detect --force
74+
75+
- name: 👁️‍🗨️ Show conan profile
76+
run: conan profile show
77+
78+
- name: 📡 Install linux default profiles
79+
run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git
80+
81+
- name: 📡 Sign into JFrog Artifactory
82+
env:
83+
PASSWORD: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN }}
84+
JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN_USER }}
85+
run: conan remote login -p $PASSWORD libhal $JFROG_USER
86+
87+
- name: 📡 Install libhal settings_user.yml
88+
run: conan config install -sf profiles/baremetal/v2 https://github.com/libhal/conan-config.git
89+
90+
- name: Set Version Environment Variable
91+
run: |
92+
if [ -z "${{ inputs.version }}" ]; then
93+
echo "VERSION=latest" >> $GITHUB_ENV
94+
else
95+
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
96+
fi
97+
98+
- name: Create `deploy.profile`
99+
run: |
100+
echo "[settings]" > deploy.profile
101+
echo "arch=${{ inputs.arch }}" >> deploy.profile
102+
echo "compiler=${{ inputs.compiler }}" >> deploy.profile
103+
echo "compiler.version=${{ inputs.compiler_version }}" >> deploy.profile
104+
echo "compiler.libcxx=libstdc++11" >> deploy.profile
105+
echo "compiler.cppstd=20" >> deploy.profile
106+
echo "os=${{ inputs.os }}" >> deploy.profile
107+
108+
- name: Add compiler to `deploy.profile` [tool_requires] section
109+
if: ${{ inputs.compiler_package != '' }}
110+
run: |
111+
echo "[tool_requires]" >> deploy.profile
112+
echo "${{ inputs.compiler_package }}/${{ inputs.compiler_version }}" >> deploy.profile
113+
114+
- name: 📦 Create `Debug` package for ${{ inputs.profile }}
115+
run: conan create . -s build_type=Debug -pr deploy.profile --version=${{ env.VERSION }}
116+
117+
- name: 📦 Create `RelWithDebInfo` package for ${{ inputs.profile }}
118+
run: conan create . -s build_type=RelWithDebInfo -pr deploy.profile --version=${{ env.VERSION }}
119+
120+
- name: 📦 Create `MinSizeRel` package for ${{ inputs.profile }}
121+
run: conan create . -s build_type=MinSizeRel -pr deploy.profile --version=${{ env.VERSION }}
122+
123+
- name: 📦 Create `Release` package for ${{ inputs.profile }}
124+
run: conan create . -s build_type=Release -pr deploy.profile --version=${{ env.VERSION }}
125+
126+
- name: 🆙 Upload package version ${{ inputs.version }} to `libhal` repo
127+
if: ${{ inputs.version != '' }}
128+
run: conan upload "${{ inputs.library }}/${{ inputs.version }}" --confirm -r=libhal

.github/workflows/deploy_all.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: 🌐 Package 📦 + 🚀 Deploy 🌐
16+
17+
# Builds packages for every device and architecture libhal supports
18+
19+
on:
20+
workflow_call:
21+
inputs:
22+
library:
23+
type: string
24+
default: ${{ github.event.repository.name }}
25+
repo:
26+
type: string
27+
default: ${{ github.repository }}
28+
version:
29+
type: string
30+
default: ""
31+
conan_version:
32+
type: string
33+
default: "2.0.14"
34+
35+
jobs:
36+
cortex-m0:
37+
uses: ./.github/workflows/deploy.yml
38+
with:
39+
library: ${{ inputs.library }}
40+
repo: ${{ inputs.repo }}
41+
version: ${{ inputs.version }}
42+
conan_version: ${{ inputs.conan_version }}
43+
compiler: gcc
44+
compiler_version: 12.3
45+
compiler_package: arm-gnu-toolchain
46+
arch: cortex-m0
47+
os: baremetal
48+
secrets: inherit
49+
cortex-m0plus:
50+
uses: ./.github/workflows/deploy.yml
51+
with:
52+
library: ${{ inputs.library }}
53+
repo: ${{ inputs.repo }}
54+
version: ${{ inputs.version }}
55+
conan_version: ${{ inputs.conan_version }}
56+
compiler: gcc
57+
compiler_version: 12.3
58+
compiler_package: arm-gnu-toolchain
59+
arch: cortex-m0plus
60+
os: baremetal
61+
secrets: inherit
62+
cortex-m1:
63+
uses: ./.github/workflows/deploy.yml
64+
with:
65+
library: ${{ inputs.library }}
66+
repo: ${{ inputs.repo }}
67+
version: ${{ inputs.version }}
68+
conan_version: ${{ inputs.conan_version }}
69+
compiler: gcc
70+
compiler_version: 12.3
71+
compiler_package: arm-gnu-toolchain
72+
arch: cortex-m1
73+
os: baremetal
74+
secrets: inherit
75+
cortex-m3:
76+
uses: ./.github/workflows/deploy.yml
77+
with:
78+
library: ${{ inputs.library }}
79+
repo: ${{ inputs.repo }}
80+
version: ${{ inputs.version }}
81+
conan_version: ${{ inputs.conan_version }}
82+
compiler: gcc
83+
compiler_version: 12.3
84+
compiler_package: arm-gnu-toolchain
85+
arch: cortex-m3
86+
os: baremetal
87+
secrets: inherit
88+
cortex-m4:
89+
uses: ./.github/workflows/deploy.yml
90+
with:
91+
library: ${{ inputs.library }}
92+
repo: ${{ inputs.repo }}
93+
version: ${{ inputs.version }}
94+
conan_version: ${{ inputs.conan_version }}
95+
compiler: gcc
96+
compiler_version: 12.3
97+
compiler_package: arm-gnu-toolchain
98+
arch: cortex-m4
99+
os: baremetal
100+
secrets: inherit
101+
cortex-m4f:
102+
uses: ./.github/workflows/deploy.yml
103+
with:
104+
library: ${{ inputs.library }}
105+
repo: ${{ inputs.repo }}
106+
version: ${{ inputs.version }}
107+
conan_version: ${{ inputs.conan_version }}
108+
compiler: gcc
109+
compiler_version: 12.3
110+
compiler_package: arm-gnu-toolchain
111+
arch: cortex-m4f
112+
os: baremetal
113+
secrets: inherit

0 commit comments

Comments
 (0)