forked from qtwebkit/qtwebkit
-
Notifications
You must be signed in to change notification settings - Fork 11
228 lines (203 loc) · 8.97 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
219
220
221
222
223
224
225
226
227
228
name: CMake Build Matrix
on:
push:
branches:
- '*'
pull_request:
branches:
- master
env:
QT_VERSION: 6.7.0
CCACHE_VERSION: 3.7.7
CACHE_PARTITION: dev
HOST_N_CORES: 2
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,
}
#- {
# name: "macOS Release", artifact: "macOS",
# os: macos-latest,
# build_type: Release,
# }
#- {
# name: "Windows MSVC Conan Release", artifact: "Windows-MSVC",
# os: windows-latest,
# build_type: Release,
# environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
# }
steps:
- name: Sparse checkout
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
BRANCH="${GITHUB_REF/#refs\/heads\//}"
# Following code is based on logs of actions/checkout@v2, with sparseCheckout stuff inserted in the middle
echo "Syncing repository: $GITHUB_REPOSITORY"
echo "Working directory is '$(pwd)' GITHUB_WORKSPACE=$GITHUB_WORKSPACE BRANCH=$BRANCH"
git version
git init $GITHUB_WORKSPACE
git remote add origin https://github.com/$GITHUB_REPOSITORY
git config --local gc.auto 0
# Now interesting part
git config core.sparseCheckout true
# FIXME: hardcode! Cannot use .travis-sparse-checkout yet
echo "/*" >> .git/info/sparse-checkout
echo "!LayoutTests" >> .git/info/sparse-checkout
git -c protocol.version=2 fetch --no-tags --prune --progress --depth=10 origin +${GITHUB_SHA}:refs/remotes/origin/${BRANCH}
git checkout --progress --force -B $BRANCH refs/remotes/origin/$BRANCH
- 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: |
py -m pip install -r Tools/qt/qt-downloader-requirements.txt
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 "::set-output name=qt_dir::${QTWINDIR}"
- name: Download Qt Mac
id: qt_mac
if: runner.os == 'macOS'
shell: bash --noprofile --norc -eo pipefail -x {0}
env:
TOOLCHAIN: "clang_64"
run: |
pip3 install -r Tools/qt/qt-downloader-requirements.txt
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 "::set-output name=qt_dir::${QTDIR}"
- 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)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: annulen/[email protected]
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 }}-
# For Conan
- uses: actions/setup-python@v1
if: runner.os == 'Windows' || runner.os == 'macOS'
with:
python-version: '3.7'
- name: Install dependencies (Conan)
if: runner.os == 'Windows' || runner.os == 'macOS'
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
pip3 install conan
- 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 libqt6opengl6-dev libqt6sensors6-dev libqt6webchannel6-dev libsqlite3-dev libwebp-dev libwoff-dev libxcomposite-dev libxml2-dev libxrender-dev libxslt1-dev mesa-common-dev pkg-config python3 qt6-base-dev qt6-base-private-dev qt6-declarative-private-dev qt6-positioning-dev ruby libqt6sql6-sqlite qt6-base-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 $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 %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 $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