Skip to content

Commit 15102aa

Browse files
ci/x86_64: add CI run for older Ubuntu versions
Added an additional run to support Ubuntu versions earlier than 24.04. Signed-off-by: Bindea Cristian <cristian.bindea@analog.com>
1 parent 6fab326 commit 15102aa

File tree

5 files changed

+74
-14
lines changed

5 files changed

+74
-14
lines changed

.github/workflows/appimage-x86_64.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ jobs:
1111
uses: ./.github/workflows/get_docker_tag.yml
1212

1313
build_scopy_x86-64_appimage:
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-latest
1515
needs: docker_tag_workflow
16+
strategy:
17+
matrix:
18+
ubuntu:
19+
- cristianbindea/scopy2-x86_64-appimage:${{ needs.docker_tag_workflow.outputs.docker_tag }}
20+
- cristianbindea/scopy2-x86_64-appimage-ubuntu20:${{ needs.docker_tag_workflow.outputs.docker_tag }}
21+
1622
container:
17-
image: cristianbindea/scopy2-x86_64-appimage:${{ needs.docker_tag_workflow.outputs.docker_tag }}
23+
image: ${{ matrix.ubuntu }}
1824
options: --user root
19-
2025
steps:
2126
- name: check storage space
2227
run: df -h
@@ -46,8 +51,9 @@ jobs:
4651
4752
- uses: actions/upload-artifact@v4
4853
with:
49-
name: scopy-linux-x86_64-${{ env.commit_sha }}
50-
path: ${{ github.workspace }}/Scopy-x86_64.AppImage
54+
name: ${{ env.app_image_folder }}-${{ env.commit_sha }}
55+
path: ${{ github.workspace }}/${{ env.app_image_name }}
56+
# app_image_folder and app_image_name are set in the x86-64_appimage_process.sh
5157

5258
- name: check storage space
5359
run: df -h

ci/ubuntu/ubuntu_build_process.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ install_packages() {
168168

169169
install_qt() {
170170
# installing Qt using the aqt tool https://github.com/miurahr/aqtinstall
171-
sudo pip3 install --no-cache-dir --break-system-packages aqtinstall
171+
[ "$PYTHON_VERSION" == "python3.12" ] && sudo pip3 install --no-cache-dir --break-system-packages aqtinstall
172+
[ "$PYTHON_VERSION" == "python3.11" ] && sudo pip3 install --no-cache-dir aqtinstall
173+
[ "$PYTHON_VERSION" == "python3.9" ] && sudo pip3 install --no-cache-dir aqtinstall
172174
sudo python3 -m aqt install-qt --outputdir $QT_INSTALL_LOCATION linux desktop 5.15.2
173175
}
174176

ci/x86_64/create_docker_image.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
#!/bin/bash -ex
22

33
SRC_SCRIPT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4-
pushd $SRC_SCRIPT
54

6-
docker build -t cristianbindea/scopy2-x86_64-appimage:testing -f docker/Dockerfile .
5+
ubuntu20(){
6+
pushd $SRC_SCRIPT
7+
docker build \
8+
-t cristianbindea/scopy2-x86_64-appimage-ubuntu20:testing \
9+
--build-arg BASE_IMAGE=ubuntu:20.04 \
10+
-f docker/Dockerfile .
11+
popd
12+
}
713

8-
popd
14+
ubuntu24(){
15+
pushd $SRC_SCRIPT
16+
docker build \
17+
-t cristianbindea/scopy2-x86_64-appimage:testing \
18+
--build-arg BASE_IMAGE=ubuntu:24.04 \
19+
-f docker/Dockerfile .
20+
popd
21+
}
22+
23+
for arg in $@; do
24+
$arg
25+
done

ci/x86_64/docker/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
FROM ubuntu:24.04
1+
ARG BASE_IMAGE=ubuntu:latest
2+
# The default image will be ubuntu:latest
3+
4+
FROM ${BASE_IMAGE}
25
SHELL ["/bin/bash", "-c"]
36

47
ARG USER=runner

ci/x86_64/x86-64_appimage_process.sh

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,30 @@ KDDOCK_BRANCH=2.1
3434
ECM_BRANCH=kf5
3535
KARCHIVE_BRANCH=kf5
3636

37-
# default python version used in CI scripts, can be changed to match locally installed python
38-
PYTHON_VERSION=python3.12
37+
if [ -f /etc/os-release ]; then
38+
. /etc/os-release
39+
40+
if [ "$ID" = "ubuntu" ]; then
41+
case "$VERSION_ID" in
42+
"20.04")
43+
PYTHON_VERSION=python3.9
44+
;;
45+
"22.04")
46+
PYTHON_VERSION=python3.11
47+
;;
48+
"24.04")
49+
PYTHON_VERSION=python3.12
50+
;;
51+
*)
52+
echo "Running on Ubuntu, but not 20.04/22.04/24.04 (detected: $VERSION_ID)"
53+
;;
54+
esac
55+
else
56+
echo "Not running on Ubuntu (detected ID=$ID)"
57+
fi
58+
else
59+
echo "/etc/os-release not found. Cannot determine OS."
60+
fi
3961

4062
QT_INSTALL_LOCATION=/opt/Qt
4163
QT=$QT_INSTALL_LOCATION/5.15.2/gcc_64
@@ -47,7 +69,15 @@ JOBS=-j14
4769

4870
APP_DIR_NAME=scopy.AppDir
4971
APP_DIR=$SRC_SCRIPT/$APP_DIR_NAME
50-
APP_IMAGE=$SRC_SCRIPT/Scopy-x86_64.AppImage
72+
73+
APP_IMAGE_FOLDER=Scopy-x86_64
74+
[ "$VERSION_ID" == "20.04" ] && APP_IMAGE_FOLDER=Scopy-x86_64-ubuntu20
75+
76+
APP_IMAGE_NAME=${APP_IMAGE_FOLDER}.AppImage
77+
APP_IMAGE=$SRC_SCRIPT/$APP_IMAGE_NAME
78+
79+
[ $CI_SCRIPT ] && echo "app_image_folder=$APP_IMAGE_FOLDER" >> "$GITHUB_ENV"
80+
[ $CI_SCRIPT ] && echo "app_image_name=$APP_IMAGE_NAME" >> "$GITHUB_ENV"
5181

5282
BUILD_STATUS_FILE=$SRC_SCRIPT/build-status
5383

@@ -107,7 +137,9 @@ clone() {
107137

108138
install_qt() {
109139
# installing Qt using the aqt tool https://github.com/miurahr/aqtinstall
110-
sudo pip3 install --no-cache-dir --break-system-packages aqtinstall
140+
[ "$PYTHON_VERSION" == "python3.12" ] && sudo pip3 install --no-cache-dir --break-system-packages aqtinstall
141+
[ "$PYTHON_VERSION" == "python3.11" ] && sudo pip3 install --no-cache-dir aqtinstall
142+
[ "$PYTHON_VERSION" == "python3.9" ] && sudo pip3 install --no-cache-dir aqtinstall
111143
sudo python3 -m aqt install-qt --outputdir $QT_INSTALL_LOCATION linux desktop 5.15.2
112144
}
113145

0 commit comments

Comments
 (0)