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

Commit 1a98ff4

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

12 files changed

Lines changed: 254 additions & 371 deletions

.github/workflows/demo_builder.yml

Lines changed: 9 additions & 21 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:
@@ -27,29 +26,25 @@ on:
2726
conan_version:
2827
type: string
2928
default: "2.0.14"
30-
profile:
31-
type: string
32-
required: true
33-
processor_profile:
29+
compiler_version:
3430
type: string
35-
default: ""
31+
default: "12.2"
3632
platform_profile:
3733
type: string
3834
default: ""
35+
profile:
36+
type: string
37+
required: true
3938

4039
jobs:
4140
build:
4241
runs-on: ubuntu-22.04
43-
if: github.event.action != 'deleted'
4442
steps:
4543
- uses: actions/checkout@v3
4644
with:
4745
submodules: true
4846
repository: ${{ inputs.repo }}
4947

50-
- name: 📥 Install CMake 3.27.7
51-
run: pip3 install cmake==3.27.7
52-
5348
- name: 📥 Install Conan ${{ inputs.conan_version }}
5449
run: pip3 install conan==${{ inputs.conan_version }}
5550

@@ -71,21 +66,14 @@ jobs:
7166
run: conan remote login -p $API_KEY libhal $JFROG_USER
7267

7368
- 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
78-
79-
- name: Install processor profiles
80-
if: inputs.processor_profile != ''
81-
run: conan config install -tf profiles -sf conan/profiles/ ${{ inputs.processor_profile }}
69+
run: conan config install -sf profiles/baremetal/v2 https://github.com/libhal/conan-config.git
8270

8371
- name: Install platform profiles
8472
if: inputs.platform_profile != ''
8573
run: conan config install -tf profiles -sf conan/profiles/ ${{ inputs.platform_profile }}
8674

8775
- name: 📦 Build package using ${{ inputs.profile }}
88-
run: conan create . -pr ${{ inputs.profile }} -s build_type=MinSizeRel
76+
run: conan create . -pr ${{ inputs.profile }} -s compiler.version=${{ inputs.compiler_version }} --version=latest
8977

9078
- name: 🏗️ Build demos for ${{ inputs.profile }}
91-
run: conan build demos -pr ${{ inputs.profile }} -s build_type=MinSizeRel
79+
run: conan build demos -pr ${{ inputs.profile }} -s compiler.version=${{ inputs.compiler_version }}

.github/workflows/deploy.yml

Lines changed: 101 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,67 +12,118 @@
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+
compiler:
30+
type: string
31+
default: "gcc"
32+
compiler_version:
33+
type: string
34+
default: "12.2"
35+
version:
36+
type: string
37+
default: ""
38+
compiler_package:
39+
type: string
40+
default: ""
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+
if: ${{ github.ref == 'refs/heads/main' }}
83+
env:
84+
API_KEY: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN }}
85+
JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_USER }}
86+
run: conan remote login -p $API_KEY libhal $JFROG_USER
87+
88+
- name: 📡 Install libhal settings_user.yml
89+
run: conan config install -sf profiles/baremetal/v2 https://github.com/libhal/conan-config.git
90+
91+
- name: Set Version Environment Variable
92+
run: |
93+
if [ -z "${{ inputs.version }}" ]; then
94+
echo "VERSION=latest" >> $GITHUB_ENV
95+
else
96+
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
97+
fi
98+
99+
- name: Create `deploy.profile`
100+
run: |
101+
echo "[settings]" > deploy.profile
102+
echo "arch=${{ inputs.arch }}" >> deploy.profile
103+
echo "compiler=${{ inputs.compiler }}" >> deploy.profile
104+
echo "compiler.version=${{ inputs.compiler_version }}" >> deploy.profile
105+
echo "compiler.libcxx=libstdc++11" >> deploy.profile
106+
echo "compiler.cppstd=20" >> deploy.profile
107+
echo "os=${{ inputs.os }}" >> deploy.profile
108+
109+
- name: Add compiler to `deploy.profile` [tool_requires] section
110+
if: ${{ inputs.compiler_package != '' }}
111+
run: |
112+
echo "[tool_requires]" >> deploy.profile
113+
echo "${{ inputs.compiler_package }}/${{ inputs.compiler_version }}" >> deploy.profile
114+
115+
- name: 📦 Create `Debug` package for ${{ inputs.profile }}
116+
run: conan create . -s build_type=Debug -pr deploy.profile --version=${{ env.VERSION }}
117+
118+
- name: 📦 Create `RelWithDebInfo` package for ${{ inputs.profile }}
119+
run: conan create . -s build_type=RelWithDebInfo -pr deploy.profile --version=${{ env.VERSION }}
120+
121+
- name: 📦 Create `MinSizeRel` package for ${{ inputs.profile }}
122+
run: conan create . -s build_type=MinSizeRel -pr deploy.profile --version=${{ env.VERSION }}
123+
124+
- name: 📦 Create `Release` package for ${{ inputs.profile }}
125+
run: conan create . -s build_type=Release -pr deploy.profile --version=${{ env.VERSION }}
126+
127+
- name: 🆙 Upload package version ${{ inputs.version }} to `libhal` repo
128+
if: ${{ inputs.version != '' }}
129+
run: conan upload "${{ inputs.library }}/${{ inputs.version }}" --confirm -r=libhal

.github/workflows/deploy_all.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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+
conan_version:
29+
type: string
30+
default: "2.0.14"
31+
compiler:
32+
type: string
33+
default: "gcc"
34+
compiler_version:
35+
type: string
36+
default: "12.2"
37+
version:
38+
type: string
39+
default: ""
40+
41+
jobs:
42+
cortex-m0:
43+
uses: ./.github/workflows/deploy.yml
44+
with:
45+
library: ${{ inputs.library }}
46+
repo: ${{ inputs.repo }}
47+
conan_version: ${{ inputs.conan_version }}
48+
compiler: ${{ inputs.compiler }}
49+
compiler_version: ${{ inputs.compiler_version }}
50+
compiler_package: arm-gnu-toolchain
51+
version: ${{ inputs.version }}
52+
arch: cortex-m0
53+
os: baremetal
54+
secrets: inherit
55+
cortex-m0plus:
56+
uses: ./.github/workflows/deploy.yml
57+
with:
58+
library: ${{ inputs.library }}
59+
repo: ${{ inputs.repo }}
60+
conan_version: ${{ inputs.conan_version }}
61+
compiler: ${{ inputs.compiler }}
62+
compiler_version: ${{ inputs.compiler_version }}
63+
compiler_package: arm-gnu-toolchain
64+
version: ${{ inputs.version }}
65+
arch: cortex-m0plus
66+
os: baremetal
67+
secrets: inherit
68+
cortex-m1:
69+
uses: ./.github/workflows/deploy.yml
70+
with:
71+
library: ${{ inputs.library }}
72+
repo: ${{ inputs.repo }}
73+
conan_version: ${{ inputs.conan_version }}
74+
compiler: ${{ inputs.compiler }}
75+
compiler_version: ${{ inputs.compiler_version }}
76+
compiler_package: arm-gnu-toolchain
77+
version: ${{ inputs.version }}
78+
arch: cortex-m1
79+
os: baremetal
80+
secrets: inherit
81+
cortex-m3:
82+
uses: ./.github/workflows/deploy.yml
83+
with:
84+
library: ${{ inputs.library }}
85+
repo: ${{ inputs.repo }}
86+
conan_version: ${{ inputs.conan_version }}
87+
compiler: ${{ inputs.compiler }}
88+
compiler_version: ${{ inputs.compiler_version }}
89+
compiler_package: arm-gnu-toolchain
90+
version: ${{ inputs.version }}
91+
arch: cortex-m3
92+
os: baremetal
93+
secrets: inherit
94+
cortex-m4:
95+
uses: ./.github/workflows/deploy.yml
96+
with:
97+
library: ${{ inputs.library }}
98+
repo: ${{ inputs.repo }}
99+
conan_version: ${{ inputs.conan_version }}
100+
compiler: ${{ inputs.compiler }}
101+
compiler_version: ${{ inputs.compiler_version }}
102+
compiler_package: arm-gnu-toolchain
103+
version: ${{ inputs.version }}
104+
arch: cortex-m4
105+
os: baremetal
106+
secrets: inherit
107+
cortex-m4f:
108+
uses: ./.github/workflows/deploy.yml
109+
with:
110+
library: ${{ inputs.library }}
111+
repo: ${{ inputs.repo }}
112+
conan_version: ${{ inputs.conan_version }}
113+
compiler: ${{ inputs.compiler }}
114+
compiler_version: ${{ inputs.compiler_version }}
115+
compiler_package: arm-gnu-toolchain
116+
version: ${{ inputs.version }}
117+
arch: cortex-m4f
118+
os: baremetal
119+
secrets: inherit

0 commit comments

Comments
 (0)