forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 132
218 lines (192 loc) · 8.04 KB
/
build_cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: CMake Build Matrix
on:
push:
branches:
- master
- qt6
pull_request:
branches:
- master
env:
QT_VERSION: 5.15.2
CCACHE_VERSION: 4.7.3
CACHE_PARTITION: dev
NINJA_STATUS: "[%f/%t %o/sec] "
CCACHE_COMPRESS: "true"
CCACHE_COMPRESSLEVEL: "6"
CCACHE_MAXSIZE: "250M"
CCACHE_SLOPPINESS: "pch_defines,time_macros"
CCACHE_HARDLINK: "true"
QT_MODULES: "qtbase qtdeclarative qtlocation qtmultimedia qtsensors qtwebchannel"
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Release", artifact: "Linux",
os: ubuntu-latest,
build_type: Release,
host_n_cores: 2,
}
- {
name: "macOS Release", artifact: "macOS",
os: macos-latest,
host_n_cores: 3,
build_type: Release,
}
- {
name: "Windows MSVC Conan Release", artifact: "Windows-MSVC",
os: windows-latest,
build_type: Release,
host_n_cores: 2,
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 10
sparse-checkout: |
/*
!LayoutTests
sparse-checkout-cone-mode: false
- uses: actions/setup-python@v4
if: runner.os == 'Windows' || runner.os == 'macOS'
with:
python-version: '3.10'
- uses: BSFishy/pip-action@v1
if: runner.os == 'Windows' || runner.os == 'macOS'
with:
requirements: Tools/qt/qt-downloader-requirements.txt
packages: |
conan<2
- name: Download Qt Windows
id: qt_win
if: runner.os == 'Windows'
env:
TOOLCHAIN: "win64_msvc2019_64"
DIR: "msvc2019_64"
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
QT_INSTALL_DIR="/c/Qt"
py Tools/qt/qt-downloader windows desktop ${QT_VERSION} ${TOOLCHAIN} --output=${QT_INSTALL_DIR} --qt_modules="${QT_MODULES}"
export QTDIR="${QT_INSTALL_DIR}/${QT_VERSION}/${DIR}"
ls $QTDIR
Tools/qt/license_writer.sh
QTWINDIR="C:\\Qt\\${QT_VERSION}\\${DIR}"
echo "qt_dir=${QTWINDIR}" >> $GITHUB_OUTPUT
- name: Download Qt Mac
id: qt_mac
if: runner.os == 'macOS'
shell: bash --noprofile --norc -eo pipefail -x {0}
env:
TOOLCHAIN: "clang_64"
run: |
QT_INSTALL_DIR="${PWD}/Qt"
Tools/qt/qt-downloader macos desktop ${QT_VERSION} ${TOOLCHAIN} --output=${QT_INSTALL_DIR} --qt_modules="${QT_MODULES}"
export QTDIR="${QT_INSTALL_DIR}/${QT_VERSION}/${TOOLCHAIN}"
ls $QTDIR
Tools/qt/license_writer.sh
echo "qt_dir=${QTDIR}" >> $GITHUB_OUTPUT
- name: Download ccache
id: ccache
shell: cmake -P {0}
run: |
set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz")
file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz)
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
- name: ccache cache files
uses: annulen/cache-action@v3.3.1-custom
with:
path: .ccache
key: ${{ matrix.config.name }}-ccache-${{ env.CACHE_PARTITION }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.config.name }}-ccache-${{ env.CACHE_PARTITION }}-
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt-get install \
ninja-build build-essential bison flex gperf libfontconfig1-dev libgl1-mesa-dev libglib2.0-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libhyphen-dev libicu-dev libjpeg-dev libpng-dev libqt5opengl5-dev libqt5sensors5-dev libqt5webchannel5-dev libsqlite3-dev libwebp-dev libwoff-dev libxcomposite-dev libxml2-dev libxrender-dev libxslt1-dev mesa-common-dev pkg-config python3 qtbase5-private-dev qtdeclarative5-private-dev qtpositioning5-dev ruby libqt5sql5-sqlite qtbase5-doc-html qttools5-dev-tools \
libtasn1-6-dev libgcrypt20-dev libunwind-dev libharfbuzz-dev
- name: CMake version
id: cmake_version
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
cmake --version
- name: CMake environment
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH
echo "CCACHE_BASEDIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV
echo "cmake_args='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DENABLE_PCH=OFF'" >> $GITHUB_ENV
- name: Configure (Linux)
if: runner.os == 'Linux'
shell: bash --noprofile --norc -eo pipefail -x {0}
run: cmake $cmake_args -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
- name: Configure (MSVC)
if: runner.os == 'Windows' && matrix.config.environment_script != ''
shell: cmd
run: py Tools\qt\build-qtwebkit-conan.py --configure --cmakeargs="%cmake_args%" --qt="${{ steps.qt_win.outputs.qt_dir }}" || exit /b 1
- name: Configure (macOS/Conan)
if: runner.os == 'macOS'
shell: bash --noprofile --norc -eo pipefail -x {0}
run: Tools/qt/build-qtwebkit-conan.py --configure --cmakeargs="$cmake_args" --qt="${{ steps.qt_mac.outputs.qt_dir }}"
- uses: actions/upload-artifact@v1
with:
path: build/CMakeCache.txt
name: CMakeCache.txt
#
# - uses: actions/upload-artifact@v1
# with:
# path: build/build.ninja
# name: build.ninja
#
# - uses: actions/upload-artifact@v1
# if: runner.os == 'Windows' || runner.os == 'macOS'
# with:
# path: build/conanbuildinfo.cmake
# name: conanbuildinfo.cmake
- name: ccache configuration
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
ccache -p
ccache -z
- name: Build (Linux)
if: runner.os == 'Linux'
shell: bash --noprofile --norc -eo pipefail -x {0}
run: ninja -C build -j ${{ matrix.config.host_n_cores }} -v
- name: Build (MSVC/Conan)
if: runner.os == 'Windows' && matrix.config.environment_script != ''
shell: cmd
run: py Tools\qt\build-qtwebkit-conan.py --build --install --ninjaargs="-j ${{ matrix.config.host_n_cores }} -v" || exit /b 1
- name: Build (macOS/Conan)
if: runner.os == 'macOS'
shell: bash --noprofile --norc -eo pipefail -x {0}
run: Tools/qt/build-qtwebkit-conan.py --build --install --ninjaargs="-j ${{ matrix.config.host_n_cores }} -v"
# - name: Verify (Linux)
# if: runner.os == 'Linux'
# shell: bash --noprofile --norc -eo pipefail -x {0}
# run: pip3 install jinja2 && Tools/qt/installed-files-checker.py --version 5.212.0 --os linux --template=Tools/qt/QtBinaryChecklist.txt --release --verbose
# - name: Verify (Mac)
# if: runner.os == 'macOS'
# shell: bash --noprofile --norc -eo pipefail -x {0}
# run: pip3 install jinja2 && Tools/qt/installed-files-checker.py --version=5.212.0 --os=macos --install_prefix="${{ steps.qt_mac.outputs.qt_dir }}" --template=Tools/qt/QtBinaryChecklist.txt --release --verbose
#
# - name: Verify (Windows)
# if: runner.os == 'Windows'
# shell: cmd
# run: py -m pip install jinja2 && py Tools\qt\installed-files-checker.py --version=5.212.0 --os=windows --install_prefix="${{ steps.qt_win.outputs.qt_dir }}" --icu_version=65 --toolchain=msvc --template=Tools\qt\QtBinaryChecklist.txt --release --verbose
- name: ccache stats
if: always()
shell: bash --noprofile --norc -eo pipefail -x {0}
run: ccache -s