Skip to content

Commit 2a73fbf

Browse files
committed
Use jurplel/install-qt-action to install Qt
1 parent 777e603 commit 2a73fbf

1 file changed

Lines changed: 16 additions & 36 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,35 @@ on:
77

88
jobs:
99
build-and-test:
10-
runs-on: ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}-latest
1111
strategy:
1212
matrix:
13-
os: [ubuntu-latest, windows-latest]
14-
qt_version: [5, 6]
15-
python_version: ["3.8", "3.9", "3.10"]
13+
os: ['ubuntu', 'windows']
14+
qt_version: [ '5.12.*', '5.15.*', '6.7.*', '6.8.*' ]
15+
python_version: ['3.9', '3.13']
1616
fail-fast: false
1717

1818
steps:
1919
- name: Checkout code
2020
uses: actions/checkout@v3
21+
22+
- name: Install MSVC
23+
if: ${{ matrix.os == 'windows' }}
24+
uses: ilammy/msvc-dev-cmd@v1
25+
with:
26+
arch: amd64
2127

2228
- name: Set up Python
2329
uses: actions/setup-python@v4
2430
with:
2531
python-version: ${{ matrix.python_version }}
2632

27-
- name: Install dependencies (Linux)
28-
if: runner.os == 'Linux'
29-
run: |
30-
sudo apt-get update
31-
if [ "${{ matrix.qt_version }}" = "5" ]; then
32-
sudo apt-get install -y qtbase5-dev qtbase5-private-dev qtchooser qt5-qmake qtbase5-dev-tools \
33-
libqt5svg5-dev qttools5-dev libqt5xmlpatterns5-dev qtmultimedia5-dev qtdeclarative5-dev \
34-
qtwebengine5-dev libqt5webkit5-dev
35-
echo "QTDIR=/usr/lib/x86_64-linux-gnu/qt5" | tee -a $GITHUB_ENV
36-
else
37-
sudo apt-get install -y qt6-base-dev qt6-base-private-dev qt6-5compat-dev qt6-base-dev-tools \
38-
libqt6svg6-dev qt6-multimedia-dev qt6-declarative-dev qt6-webengine-dev
39-
echo "QTDIR=/usr/lib/x86_64-linux-gnu/qt6" | tee -a $GITHUB_ENV
40-
fi
41-
42-
- name: Install dependencies (Windows)
43-
if: runner.os == 'Windows'
44-
run: |
45-
if ("${{ matrix.qt_version }}" -eq "5") {
46-
pip install aqtinstall
47-
aqt install-qt windows desktop 5.15.2 win64_msvc2019 -m all
48-
$Qt5Dir = "$env:USERPROFILE\Qt\5.15.2\msvc2019_64"
49-
echo "Qt5Dir=$Qt5Dir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
50-
echo "$Qt5Dir\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
51-
echo "QTDIR=$Qt5Dir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
52-
} else {
53-
choco install -y qt6-base-dev qt6-base-private-dev qt6-5compat-dev qt6-base-dev-tools `
54-
libqt6svg6-dev qt6-multimedia-dev qt6-declarative-dev qt6-webengine-dev `
55-
--params "/InstallationFolder C:/Qt/${{ matrix.qt_version }}"
56-
echo "C:/Qt/${{ matrix.qt_version }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
57-
echo "QTDIR=C:/Qt/${{ matrix.qt_version }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
58-
}
33+
- name: Install Qt ${{matrix.qt-version}}
34+
uses: jurplel/install-qt-action@v4
35+
with:
36+
version: ${{ matrix.qt-version }}
37+
modules: ${{startsWith(matrix.qt-version, '6') && 'qt5compat qtscxml qtpositioning qtwebchannel qtmultimedia qtwebengine' || '' }}
38+
arch: ${{ (matrix.os == 'ubuntu' && (startsWith(matrix.qt-version, '5') && 'gcc_64' || 'linux_gcc_64')) || startsWith(matrix.qt-version, '5.12') && 'win64_msvc2017_64' || startsWith(matrix.qt-version, '6.8') && 'win64_msvc2022_64' || 'win64_msvc2019_64' }}
5939

6040
- name: Configure CMake
6141
run: |

0 commit comments

Comments
 (0)