Skip to content

Commit 47e5358

Browse files
committed
ci: create a composite action for the compile job
We want to split the compile job matrix into two steps. In order to avoid too much duplication of code, let's first isolate the compile steps into a custom , local composite action. In the next commit, we will split the matrix into two, and reuse the action. Signed-off-by: Nicolas Dechesne <[email protected]>
1 parent a293cc0 commit 47e5358

File tree

2 files changed

+53
-27
lines changed

2 files changed

+53
-27
lines changed

.github/actions/compile/action.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Run a specific build configuration
2+
inputs:
3+
machine:
4+
required: true
5+
bsp:
6+
required: true
7+
cache_dir:
8+
required: true
9+
manifest_url:
10+
required: true
11+
manifest_branch:
12+
required: true
13+
qli_version:
14+
required: true
15+
runs:
16+
using: "composite"
17+
steps:
18+
- name: Get manifest file
19+
run: |
20+
git clone --depth=1 ${{inputs.manifest_url}} -b ${{inputs.manifest_branch}}
21+
cd qcom-manifest
22+
MANIFEST_FILE=$(ls *${{inputs.qli_version}}*.xml | sort | grep -v -e realtime-linux -e qim-product-sdk -e robotics-product-sdk | tail -1)
23+
echo "Manifest file: ${MANIFEST_FILE}"
24+
echo "MANIFEST_FILE=${MANIFEST_FILE}" >> "$GITHUB_ENV"
25+
26+
- name: Setup workspace
27+
run: |
28+
mkdir QLI
29+
cd QLI
30+
repo init -u ${{inputs.manifest_url}} -b ${{inputs.manifest_branch}} -m ${MANIFEST_FILE}
31+
repo sync
32+
mkdir -p ${{inputs.cache_dir}}/{downloads,sstate-cache}
33+
ln -s ${{inputs.cache_dir}}/downloads
34+
ln -s ${{inputs.cache_dir}}/sstate-cache
35+
36+
- name: Build QLI
37+
run: |
38+
cd QLI
39+
# FIXME: apply_poky_patches() fails in setup-environment and it's not
40+
# needed, so skip it for now, until it's fixed properly.
41+
sed -i '/ apply_poky_patches/d' setup-environment
42+
MACHINE=${{ inputs.machine }} DISTRO=qcom-wayland QCOM_SELECTED_BSP=${{ inputs.bsp }} source setup-environment
43+
bitbake-layers add-layer $GITHUB_WORKSPACE
44+
bitbake qcom-console-image

.github/workflows/build.yml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,12 @@ jobs:
3434
steps:
3535
- uses: actions/checkout@v4
3636

37-
- name: Get manifest file
38-
run: |
39-
git clone --depth=1 ${MANIFEST_URL} -b ${MANIFEST_BRANCH}
40-
cd qcom-manifest
41-
MANIFEST_FILE=$(ls *${QLI_VERSION}*.xml | sort | grep -v -e realtime-linux -e qim-product-sdk -e robotics-product-sdk | tail -1)
42-
echo "Manifest file: ${MANIFEST_FILE}"
43-
echo "MANIFEST_FILE=${MANIFEST_FILE}" >> "$GITHUB_ENV"
44-
45-
- name: Setup workspace
46-
run: |
47-
mkdir QLI
48-
cd QLI
49-
repo init -u ${MANIFEST_URL} -b ${MANIFEST_BRANCH} -m ${MANIFEST_FILE}
50-
repo sync
51-
mkdir -p ${CACHE_DIR}/{downloads,sstate-cache}
52-
ln -s ${CACHE_DIR}/downloads
53-
ln -s ${CACHE_DIR}/sstate-cache
54-
55-
- name: Build QLI
56-
run: |
57-
cd QLI
58-
# FIXME: apply_poky_patches() fails in setup-environment and it's not
59-
# needed, so skip it for now, until it's fixed properly.
60-
sed -i '/ apply_poky_patches/d' setup-environment
61-
MACHINE=${{ matrix.machine }} DISTRO=qcom-wayland QCOM_SELECTED_BSP=${{ matrix.bsp }} source setup-environment
62-
bitbake-layers add-layer $GITHUB_WORKSPACE
63-
bitbake qcom-console-image
37+
- name: Run build
38+
uses: ./.github/actions/compile
39+
with:
40+
machine: ${{matrix.machine}}
41+
bsp: ${{matrix.bsp}}
42+
cache_dir: ${CACHE_DIR}
43+
manifest_url: ${MANIFEST_URL}
44+
manifest_branch: ${MANIFEST_BRANCH}
45+
qli_version: ${QLI_VERSION}

0 commit comments

Comments
 (0)