Skip to content

Commit 0c18527

Browse files
committed
preserve CI on ubuntu 18 in addition to adding ubuntu 20 and newer qmlfmt
1 parent 444db0a commit 0c18527

File tree

7 files changed

+67
-16
lines changed

7 files changed

+67
-16
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Copyright (c) 2020, 219 Design, LLC
3+
# See LICENSE.txt
4+
#
5+
# https://www.219design.com
6+
# Software | Electrical | Mechanical | Product Design
7+
#
8+
name: Linux_CI_Ubuntu18
9+
10+
on: [push]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-18.04
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
20+
# Remove apt repos that are known to break from time to time
21+
# See https://github.com/actions/virtual-environments/issues/323
22+
- name: Remove broken apt repos
23+
run: |
24+
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
25+
26+
- if: runner.os == 'Linux'
27+
# Fix (another kind) of azure ubuntu apt repo issue. (Unable to connect to azure.archive.ubuntu.com)
28+
run: sed -e 's/azure.archive.ubuntu.com/us.archive.ubuntu.com/g' -e t -e d /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/nonazure.list
29+
30+
- name: run_all_tests
31+
env:
32+
MYAPP_TEMPLATE_BUILD_ANDROID: 1
33+
MYAPP_TEMPLATE_BUILD_APPIMAGE: 1
34+
MYAPP_TEMPLATE_LEGACY_UBUNTU18: 1
35+
run: ./run_all_tests.sh

cookiecutter/init_repo.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ git add .
1919

2020
git add -f AppImage_staging/.do_not_format
2121
git add -f dl_third_party/.do_not_format
22-
git add -f dl_third_party/Qt_desktop/6.2.2/clang_64/extrabin/macos/qmlfmt
22+
git add -f dl_third_party/Qt_desktop/5.15.0/clang_64/extrabin/macos/qmlfmt
23+
git add -f dl_third_party/Qt_desktop/5.15.0/gcc_64/extrabin/qmlfmt
24+
# git add -f dl_third_party/Qt_desktop/6.2.2/clang_64/extrabin/macos/qmlfmt # TODO(pestophagous)
2325
git add -f dl_third_party/Qt_desktop/6.2.2/gcc_64/extrabin/qmlfmt
2426
git add -f dl_third_party/Qt_desktop/5.15.0/ios/mkspecs/qconfig.pri
2527
git add -f dl_third_party/Qt_desktop/5.15.0/msvc2019_64/mkspecs/qconfig.pri
6.4 MB
Binary file not shown.

tools/ci/get_qt_libs.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ else
5454

5555
# we still need qt6 in order to execute qmlfmt.
5656
# https://github.com/miurahr/aqtinstall/issues/126 "Installing smaller subset of the libraries"
57-
#python3 -m aqt install-qt --base "${QTMIRROR}" --outputdir $DL_FOLDER/Qt_desktop linux desktop 6.2.2 --archives \
58-
# icu \
59-
# qtbase \
60-
# qt5compat
6157
python3 -m aqt install-qt --base "${QTMIRROR}" --outputdir $DL_FOLDER/Qt_desktop linux desktop 6.2.2 --modules \
6258
qt5compat
6359
fi

tools/ci/get_qt_libs_mac.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ else
2929
qtsvg \
3030
qttools
3131

32-
bash -x $CUR_GIT_ROOT/tools/ci/install-qt.sh \
33-
--directory $DL_FOLDER/Qt_desktop \
34-
--version 6.2.2 \
35-
qtbase \
36-
qt5compat
37-
3832
fi
3933

4034
if [ -d $DL_FOLDER/Qt_desktop/5.15.0/ios/bin ]; then
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#_use_file_paths_from_GIT_ROOT_and_with_no_whitespace
2+
#
3+
# Note: the QML files that are checked in have been formatted using a
4+
# relatively up-to-date edition of qmlfmt. However, on our legacy
5+
# builds we use an older qmlfmt, due to Ubuntu 18 not providing the
6+
# needed GLibC version to execute the newer qmlfmt.
7+
# When running the older qmlfmt, we have to ignore format violations
8+
# on a few files that the newer qmlfmt prettifies BETTER nowadays.
9+
# (In other words, the older qmlfmt complains about these files, even
10+
# though now they look nicer than what the older qmlfmt can manage.)
11+
#
12+
src/app/imports.qml
13+
src/lib_app/qml/main.qml
14+
src/lib_app/qml/viewColorPalette.qml
15+
src/libstyles/imports/libstyles/Theme.qml

tools/formatters/enforce_qml_format.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,28 @@ if [[ -n ${MYAPP_TEMPLATE_DL_FOLDER_OVERRIDE-} ]]; then
2727
DL_FOLDER=${MYAPP_TEMPLATE_DL_FOLDER_OVERRIDE}
2828
fi
2929

30+
MY_QT_VERSION=6.2.2
31+
MY_FMT_EXTRAARGS="-i 2" # newer qmlfmt supports indent spaces count
32+
33+
if [[ -n ${MYAPP_TEMPLATE_LEGACY_UBUNTU18-} ]]; then
34+
MY_QT_VERSION=5.15.0
35+
MY_FMT_EXTRAARGS=""
36+
cp "${THISDIR}/enforce_qml_format.exclusions.legacy_qmlfmt" "${THISDIR}/enforce_qml_format.exclusions"
37+
fi
38+
3039
if [[ "$OSTYPE" == "darwin"* ]]; then
31-
qml_formatter="${DL_FOLDER}/Qt_desktop/6.2.2/clang_64/extrabin/macos/qmlfmt"
40+
qml_formatter="${DL_FOLDER}/Qt_desktop/${MY_QT_VERSION}/clang_64/extrabin/macos/qmlfmt"
3241
else
33-
export LD_LIBRARY_PATH="${DL_FOLDER}/Qt_desktop/6.2.2/gcc_64/lib"
34-
qml_formatter="${DL_FOLDER}/Qt_desktop/6.2.2/gcc_64/extrabin/qmlfmt"
42+
export LD_LIBRARY_PATH="${DL_FOLDER}/Qt_desktop/${MY_QT_VERSION}/gcc_64/lib"
43+
qml_formatter="${DL_FOLDER}/Qt_desktop/${MY_QT_VERSION}/gcc_64/extrabin/qmlfmt"
3544
fi
3645

3746
check_format() {
3847
if [ $only_report != 0 ]; then
3948
while read filenames; do
4049
for fl in "$filenames"; do
4150
echo checking format of "$fl"
42-
result=$("$qml_formatter" -l "$fl" -i 2)
51+
result=$("$qml_formatter" -l "$fl" ${MY_FMT_EXTRAARGS})
4352
if [[ ! -z "$result" ]]; then
4453
# https://stackoverflow.com/a/34066473/10278 (find string in bash array)
4554
if echo ${the_exclusions[@]} | grep -q -w "$fl"; then
@@ -65,7 +74,7 @@ check_format() {
6574
if echo ${the_exclusions[@]} | grep -q -w "$fl"; then
6675
echo "INTENTIONAL EXLUSION OF $fl"
6776
else
68-
"$qml_formatter" -w "$fl" -i 2
77+
"$qml_formatter" -w "$fl" ${MY_FMT_EXTRAARGS}
6978
fi
7079
done
7180
done

0 commit comments

Comments
 (0)