Skip to content

Commit 56122c4

Browse files
authored
📄 Remove license download & performance improvements to CI (#33)
* 📄 Remove license download We get 403 Forbidden errors when we attempt to download the license. Rather than go out of our way to download their external license, we should just download the binaries from the official source and call it a day. * Reduce parallel CI images * bringing all CI back * Adding the rest back
1 parent 2e122b1 commit 56122c4

5 files changed

Lines changed: 129 additions & 102 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/bin/bash
2+
3+
# # Use defaults
4+
# ./baremetal_package.sh
5+
#
6+
# # Specify custom values
7+
# ./baremetal_package.sh --dir ./myproject --version 1.2.3 --compiler-profile hal/tc/gcc --arch-list cortex-m0,cortex-m3,cortex-m4
8+
#
9+
# # Just change architecture list
10+
# ./baremetal_package.sh --arch-list cortex-m0,cortex-m1,cortex-m3
11+
12+
# Exit script on any error
13+
set -e
14+
set -x
15+
16+
# Default values
17+
DIR="."
18+
VERSION="latest"
19+
COMPILER_PROFILE="hal/tc/llvm"
20+
ARCH_LIST=("cortex-m3")
21+
CONAN_VERSION=2.23.0
22+
EXTRA_CONAN_ARGS=""
23+
24+
# Parse command line arguments
25+
while [[ $# -gt 0 ]]; do
26+
case $1 in
27+
--dir)
28+
DIR="$2"
29+
shift 2
30+
;;
31+
--version)
32+
VERSION="$2"
33+
shift 2
34+
;;
35+
--compiler-profile)
36+
COMPILER_PROFILE="$2"
37+
shift 2
38+
;;
39+
--conan-version)
40+
CONAN_VERSION="$2"
41+
shift 2
42+
;;
43+
--arch-list)
44+
IFS=',' read -ra ARCH_LIST <<< "$2"
45+
shift 2
46+
;;
47+
--extra-conan-args)
48+
EXTRA_CONAN_ARGS="$2"
49+
shift 2
50+
;;
51+
*)
52+
echo "Unknown option: $1"
53+
echo "Usage: $0 [--dir DIR] [--version VERSION] [--compiler-profile PROFILE] [--conan-version VERSION] [--arch-list ARCH1,ARCH2,...] [--extra-conan-args ARGS]"
54+
exit 1
55+
;;
56+
esac
57+
done
58+
59+
# Log configuration
60+
echo "========================================"
61+
echo "Baremetal Package Build Configuration"
62+
echo "========================================"
63+
echo "DIR: $DIR"
64+
echo "VERSION: $VERSION"
65+
echo "COMPILER_PROFILE: $COMPILER_PROFILE"
66+
echo "CONAN_VERSION: $CONAN_VERSION"
67+
echo "ARCH_LIST: ${ARCH_LIST[*]}"
68+
echo "EXTRA_CONAN_ARGS: $EXTRA_CONAN_ARGS"
69+
echo "========================================"
70+
71+
# Setup conan & libhal
72+
pipx install conan>=$CONAN_VERSION
73+
conan config install https://github.com/libhal/conan-config2.git
74+
conan hal setup
75+
76+
# Loop over architectures and build types
77+
for ARCH in "${ARCH_LIST[@]}"; do
78+
echo "Building for architecture: $ARCH"
79+
80+
conan build $DIR -s:h build_type=Debug -s:h os=baremetal -s:h arch=$ARCH --version $VERSION -pr:h $COMPILER_PROFILE --build=missing $EXTRA_CONAN_ARGS
81+
82+
conan build $DIR -s:h build_type=MinSizeRel -s:h os=baremetal -s:h arch=$ARCH --version $VERSION -pr:h $COMPILER_PROFILE --build=missing $EXTRA_CONAN_ARGS
83+
84+
conan build $DIR -s:h build_type=Release -s:h os=baremetal -s:h arch=$ARCH --version $VERSION -pr:h $COMPILER_PROFILE --build=missing $EXTRA_CONAN_ARGS
85+
done

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
branches:
88
- main
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
ci_11_3:
1216
uses: ./.github/workflows/11.3.yml

.github/workflows/verify.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ jobs:
4646
- name: 📥 Install CMake & Conan
4747
run: pipx install conan>=2.22.2
4848

49-
- name: 📡 Add `libhal` conan remote
50-
run: |
51-
conan remote add libhal https://libhal.jfrog.io/artifactory/api/conan/trunk-conan
52-
53-
- name: 📡 Create and setup default profile
54-
run: conan profile detect --force
55-
56-
- name: 👁️‍🗨️ Show conan profile
57-
run: conan profile show
58-
5949
- name: 📡 Install libhal/conan-config2
6050
run: conan config install https://github.com/libhal/conan-config2.git
6151

.github/workflows/verify_and_upload.yml

Lines changed: 38 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -27,104 +27,73 @@ jobs:
2727
verify-linux-x86_64:
2828
uses: ./.github/workflows/verify.yml
2929
with:
30-
version: ${{ inputs.VERSION }}
30+
version: ${{ inputs.version }}
3131
runner_os: ubuntu-24.04
3232
arch: cortex-m4
3333

34-
verify-linux-x86_64_cortex-m0:
35-
uses: ./.github/workflows/verify.yml
36-
with:
37-
version: ${{ inputs.VERSION }}
38-
runner_os: ubuntu-24.04
39-
arch: cortex-m0
40-
41-
verify-linux-x86_64_cortex-m0plus:
42-
uses: ./.github/workflows/verify.yml
43-
with:
44-
version: ${{ inputs.VERSION }}
45-
runner_os: ubuntu-24.04
46-
arch: cortex-m0plus
47-
48-
verify-linux-x86_64_cortex-m1:
49-
uses: ./.github/workflows/verify.yml
50-
with:
51-
version: ${{ inputs.VERSION }}
52-
runner_os: ubuntu-24.04
53-
arch: cortex-m1
54-
55-
verify-linux-x86_64_cortex-m3:
56-
uses: ./.github/workflows/verify.yml
57-
with:
58-
version: ${{ inputs.VERSION }}
59-
runner_os: ubuntu-24.04
60-
arch: cortex-m3
61-
62-
verify-linux-x86_64_cortex-m4:
63-
uses: ./.github/workflows/verify.yml
64-
with:
65-
version: ${{ inputs.VERSION }}
66-
runner_os: ubuntu-24.04
67-
arch: cortex-m4
68-
69-
verify-linux-x86_64_cortex-m4f:
70-
uses: ./.github/workflows/verify.yml
71-
with:
72-
version: ${{ inputs.VERSION }}
73-
runner_os: ubuntu-24.04
74-
arch: cortex-m4f
75-
76-
verify-linux-x86_64_cortex-m7d:
77-
uses: ./.github/workflows/verify.yml
78-
with:
79-
version: ${{ inputs.VERSION }}
80-
runner_os: ubuntu-24.04
81-
arch: cortex-m7d
82-
83-
verify-linux-x86_64_cortex-m23:
84-
uses: ./.github/workflows/verify.yml
85-
with:
86-
version: ${{ inputs.VERSION }}
87-
runner_os: ubuntu-24.04
88-
arch: cortex-m23
89-
9034
verify-linux-arm:
9135
uses: ./.github/workflows/verify.yml
9236
with:
93-
version: ${{ inputs.VERSION }}
37+
version: ${{ inputs.version }}
9438
runner_os: ubuntu-24.04-arm
9539
arch: cortex-m4
9640

9741
verify-macos-15-arm:
9842
uses: ./.github/workflows/verify.yml
9943
with:
100-
version: ${{ inputs.VERSION }}
44+
version: ${{ inputs.version }}
10145
runner_os: macos-15
10246
arch: cortex-m4
10347

10448
verify-windows-x86_64:
10549
uses: ./.github/workflows/verify.yml
10650
with:
107-
version: ${{ inputs.VERSION }}
51+
version: ${{ inputs.version }}
10852
runner_os: windows-latest
10953
arch: cortex-m4
11054

55+
cortex-m_gcc:
56+
runs-on: ubuntu-latest
57+
env:
58+
VERBOSE: 1
59+
steps:
60+
- name: 📥 Checkout target repository
61+
uses: actions/checkout@v2
62+
with:
63+
submodules: true
64+
fetch-depth: 0
65+
66+
- name: 📥 Install CMake & Conan
67+
run: pipx install conan>=2.22.2
68+
69+
- name: 📡 Install libhal/conan-config2
70+
run: conan config install https://github.com/libhal/conan-config2.git
71+
72+
- name: 📡 Run `conan hal setup`
73+
run: conan hal setup
74+
75+
- name: 📦 Create Conan Package
76+
run: conan create all --version=${{ inputs.version }}
77+
78+
- name: 📦 Build packages for all Cortex-M architectures
79+
run: |
80+
bash .github/scripts/build_all_variants.sh \
81+
--dir demo \
82+
--version ${{ inputs.version }} \
83+
--compiler-profile conan/profiles/v1/arm-gcc-${{ inputs.version }} \
84+
--conan-version 2.22.2 \
85+
--arch-list cortex-m0,cortex-m0plus,cortex-m1,cortex-m3,cortex-m4,cortex-m4f,cortex-m7f,cortex-m7d,cortex-m23,cortex-m33,cortex-m33f,cortex-m35pf,cortex-m55,cortex-m85
86+
11187
upload-package:
11288
needs:
11389
- verify-linux-x86_64
11490
- verify-linux-arm
11591
- verify-macos-15-arm
11692
- verify-windows-x86_64
117-
- verify-linux-x86_64_cortex-m0
118-
- verify-linux-x86_64_cortex-m0plus
119-
- verify-linux-x86_64_cortex-m1
120-
- verify-linux-x86_64_cortex-m3
121-
- verify-linux-x86_64_cortex-m4
122-
- verify-linux-x86_64_cortex-m4f
123-
- verify-linux-x86_64_cortex-m7d
124-
- verify-linux-x86_64_cortex-m23
93+
- cortex-m_gcc
12594

12695
if: ${{ startsWith(github.ref, 'refs/tags/') }}
12796
uses: ./.github/workflows/upload.yml
12897
secrets: inherit
12998
with:
130-
version: ${{ inputs.VERSION }}
99+
version: ${{ inputs.version }}

all/conanfile.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -94,32 +94,11 @@ def package(self):
9494
copy(self, pattern="toolchain.cmake", src=self.source_folder,
9595
dst=RESOURCE_DIR, keep_path=True)
9696

97+
# Use local path OR
9798
if self.options.local_path:
9899
self.package_local_path()
99100
return
100-
101-
# Otherwise, download the toolchain
102-
103-
VERSION_MAP = {
104-
# License URL found from the "EULA" button on the
105-
# https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
106-
# web page.
107-
"11.3": "https://developer.arm.com/GetEula?Id=ff19df33-da82-491a-ab50-c605d4589a26",
108-
"11": "https://developer.arm.com/GetEula?Id=ff19df33-da82-491a-ab50-c605d4589a26",
109-
"12.2": "https://developer.arm.com/GetEula?Id=2821586b-44d0-4e75-a06d-4279cd97eaae",
110-
"12.3": "https://developer.arm.com/GetEula?Id=aa3d692d-bc99-4c8c-bce2-588181ddde13",
111-
"12": "https://developer.arm.com/GetEula?Id=aa3d692d-bc99-4c8c-bce2-588181ddde13",
112-
"13.2": "https://developer.arm.com/GetEula?Id=37988a7c-c40e-4b78-9fd1-62c20b507aa8",
113-
"13.3": "https://developer.arm.com/GetEula?Id=d023c29f-8e81-49b0-979f-a5610ea2ccbb",
114-
"13": "https://developer.arm.com/GetEula?Id=d023c29f-8e81-49b0-979f-a5610ea2ccbb",
115-
"14.2": "https://developer.arm.com/GetEula?Id=3aa52a53-d1cb-414b-b540-eaf29fdef0ca",
116-
"14.3": "https://developer.arm.com/GetEula?Id=15d9660a-2059-4985-85e9-c01cdd4b1ba0",
117-
"14": "https://developer.arm.com/GetEula?Id=15d9660a-2059-4985-85e9-c01cdd4b1ba0",
118-
}
119-
120-
if self.version in VERSION_MAP:
121-
download(self, VERSION_MAP[self.version], "LICENSE", verify=False)
122-
101+
# Download the toolchain...
123102
OS = str(self._settings_build.os)
124103
VERSION = self.version
125104
ARCH = str(self._settings_build.arch)

0 commit comments

Comments
 (0)