Skip to content

Commit 8f94e20

Browse files
committed
Fix Ubuntu 20.04 workflow triggers and versioned build setup
1 parent e519aab commit 8f94e20

1 file changed

Lines changed: 49 additions & 44 deletions

File tree

.github/workflows/ubuntu-20.04.yml

Lines changed: 49 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
22

3-
name: Ubuntu 20.04 build
3+
name: Ubuntu 20.04 Focal build
44

55
on:
66
push:
7-
branches:
8-
- main
9-
tags:
10-
- '**'
117
workflow_dispatch:
128

139
permissions:
1410
contents: read
1511

12+
env:
13+
QT_VERSION: 6.10.3
14+
QT_PREFIX: /opt/qt/6.10.3
15+
1616
jobs:
1717
build:
18-
name: Ubuntu 20.04 (focal)
18+
name: Ubuntu 20.04 (Focal)
1919
runs-on: ubuntu-24.04
2020
container: ubuntu:20.04
2121

2222
env:
2323
DEBIAN_FRONTEND: noninteractive
2424
TZ: Etc/UTC
25+
CMAKE_VERSION: 3.31.8
2526

2627
steps:
2728
- name: Check out repository
28-
uses: actions/checkout@v7
29+
uses: actions/checkout@v4
2930
with:
3031
fetch-depth: 0
3132

32-
- name: Prepare build container
33+
- name: Prepare Focal build environment
3334
shell: bash
3435
run: |
3536
set -o pipefail
@@ -43,44 +44,51 @@ jobs:
4344
echo
4445
echo '=== CPU ==='
4546
nproc
46-
echo
47-
echo '=== Git ==='
48-
git --version || true
4947
} | tee logs/00-environment.log
5048
5149
apt-get update 2>&1 | tee logs/01-apt-update.log
5250
apt-get install -y --no-install-recommends \
53-
bash \
54-
ca-certificates \
55-
git \
56-
sudo \
57-
wget \
58-
curl \
59-
xz-utils \
60-
file \
61-
pkg-config \
62-
ninja-build \
63-
build-essential \
64-
python3 \
65-
python3-pip \
51+
bash ca-certificates git wget curl xz-utils file pkg-config \
52+
ninja-build build-essential python3 python3-pip sudo \
6653
2>&1 | tee logs/02-base-packages.log
6754
55+
- name: Install CMake
56+
shell: bash
57+
run: |
58+
set -o pipefail
59+
wget -qO- "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" \
60+
| tar -xz -C /opt
61+
ln -sf "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/cmake" /usr/local/bin/cmake
62+
ln -sf "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/ctest" /usr/local/bin/ctest
63+
cmake --version 2>&1 | tee logs/03-cmake-version.log
64+
6865
- name: Install Mixxx build dependencies
6966
shell: bash
7067
run: |
7168
set -o pipefail
7269
chmod +x tools/debian_buildenv.sh
73-
./tools/debian_buildenv.sh setup 2>&1 | tee logs/03-mixxx-buildenv.log
70+
./tools/debian_buildenv.sh setup 2>&1 | tee logs/04-mixxx-buildenv.log
71+
72+
- name: Verify Qt 6
73+
shell: bash
74+
run: |
75+
set -o pipefail
76+
if [ ! -x "${QT_PREFIX}/bin/qmake" ]; then
77+
echo "ERROR: Qt ${QT_VERSION} was not found at ${QT_PREFIX}" | tee logs/05-qt-check.log
78+
exit 1
79+
fi
80+
"${QT_PREFIX}/bin/qmake" --version 2>&1 | tee logs/05-qt-check.log
7481
7582
- name: Configure
7683
shell: bash
84+
env:
85+
PATH: /opt/qt/6.10.3/bin:${{ env.PATH }}
86+
CMAKE_PREFIX_PATH: /opt/qt/6.10.3
7787
run: |
7888
set -o pipefail
79-
mkdir -p build
8089
cmake \
81-
-S . \
82-
-B build \
83-
-DCMAKE_BUILD_TYPE=Release \
90+
-S . -B build \
91+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
8492
-DQT6=ON \
8593
-DQML=ON \
8694
-DBULK=ON \
@@ -90,27 +98,23 @@ jobs:
9098
-DMODPLUG=ON \
9199
-DWAVPACK=ON \
92100
-DINSTALL_USER_UDEV_RULES=OFF \
93-
2>&1 | tee logs/04-cmake-configure.log
101+
2>&1 | tee logs/06-cmake-configure.log
94102
95103
- name: Build
96104
shell: bash
105+
env:
106+
PATH: /opt/qt/6.10.3/bin:${{ env.PATH }}
107+
CMAKE_PREFIX_PATH: /opt/qt/6.10.3
97108
run: |
98109
set -o pipefail
99-
cmake --build build -j "$(nproc)" 2>&1 | tee logs/05-cmake-build.log
110+
cmake --build build -j "$(nproc)" 2>&1 | tee logs/07-cmake-build.log
100111
101112
- name: Run tests
102113
if: success()
103114
shell: bash
104115
run: |
105116
set -o pipefail
106-
ctest --test-dir build --output-on-failure 2>&1 | tee logs/06-ctest.log
107-
108-
- name: Package
109-
if: success()
110-
shell: bash
111-
run: |
112-
set -o pipefail
113-
cmake --build build --target package 2>&1 | tee logs/07-package.log
117+
ctest --test-dir build --output-on-failure 2>&1 | tee logs/08-ctest.log
114118
115119
- name: Collect diagnostics
116120
if: always()
@@ -121,19 +125,20 @@ jobs:
121125
git status --short
122126
echo
123127
echo '=== CMake cache ==='
124-
if [ -f build/CMakeCache.txt ]; then
125-
grep -E '^(CMAKE_(BUILD_TYPE|CXX_COMPILER|C_COMPILER):|QT6:|FFMPEG:)' build/CMakeCache.txt || true
126-
fi
128+
grep -E '^(CMAKE_(BUILD_TYPE|CXX_COMPILER|C_COMPILER):|QT6:|FFMPEG:)' build/CMakeCache.txt 2>/dev/null || true
129+
echo
130+
echo '=== Qt ==='
131+
"${QT_PREFIX}/bin/qmake" --version 2>/dev/null || true
127132
echo
128133
echo '=== Built files ==='
129-
find build -maxdepth 2 -type f \( -name '*.deb' -o -name 'mixxx' \) -print 2>/dev/null || true
134+
find build -maxdepth 3 -type f \( -name '*.deb' -o -name 'mixxx' \) -print 2>/dev/null || true
130135
} | tee logs/99-diagnostics.log
131136
132137
- name: Upload build logs and artifacts
133138
if: always()
134139
uses: actions/upload-artifact@v4
135140
with:
136-
name: ubuntu-20.04-build-${{ github.run_number }}
141+
name: ubuntu-20.04-focal-${{ github.run_number }}
137142
path: |
138143
logs/
139144
build/*.deb

0 commit comments

Comments
 (0)