Repository navigation
171 lines (142 loc) · 5.59 KB
/
Copy pathcmake.yml
File metadata and controls
171 lines (142 loc) · 5.59 KB
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
name: 'Build with CMake'
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
# A new push to a pull request supersedes its running build. Each push to a
# branch gets a group of its own, so no commit on master loses its run.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
env:
BUILD_DEPS: bison flex g++ make cmake
permissions:
contents: read
jobs:
compiler:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Configure apt retries and timeouts
run: sudo cp .github/apt/99-ci-network /etc/apt/apt.conf.d/
- name: Install dependencies
timeout-minutes: 10
run: |
sudo apt-get update -yq
sudo apt-get install -y --no-install-recommends $BUILD_DEPS
- name: Generate makefile using CMake
timeout-minutes: 10
run: |
mkdir cmake_build
cd cmake_build
cmake .. -DBUILD_LIBRARIES=OFF
- name: Run make
timeout-minutes: 30
run: |
cd cmake_build
cmake --build .
- name: Run test
timeout-minutes: 30
run: |
cd cmake_build
ctest -j$(nproc --ignore=2)
- name: Build and run compiler tests on their own
timeout-minutes: 30
run: |
# Configures compiler/cpp/tests directly, as its README describes
mkdir compiler/cpp/tests/cmake_build
cd compiler/cpp/tests/cmake_build
cmake ..
cmake --build .
ctest --no-tests=error -j$(nproc --ignore=2)
- name: Upload LastTest log
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cmake-LastTest-log
path: cmake_build/Testing/Temporary/LastTest.log
if-no-files-found: warn
lib-cpp-without-boost:
# The C++ library and the tutorials must build where Boost is not
# installed; a plain container keeps any Boost header out of reach.
runs-on: ubuntu-24.04
container: ubuntu:24.04@sha256:68ee22004a9109b44973313b02ff7b1de250f1de0f5ecb628d73f579aaff33ac
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Configure apt retries and timeouts
run: cp .github/apt/99-ci-network /etc/apt/apt.conf.d/
- name: Install dependencies
timeout-minutes: 10
run: |
apt-get update -yq
apt-get install -y --no-install-recommends bison flex g++ libevent-dev libssl-dev zlib1g-dev make cmake
- name: Generate makefile using CMake
timeout-minutes: 10
run: |
cmake -S . -B cmake_build -DCMAKE_CXX_STANDARD=11 -DBUILD_TESTING=OFF \
-DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_JAVASCRIPT=OFF -DWITH_NODEJS=OFF -DWITH_PYTHON=OFF
- name: Run make
timeout-minutes: 30
run: cmake --build cmake_build -j"$(nproc)"
- name: Run install
run: cmake --install cmake_build --prefix cmake_install
compiler-windows:
runs-on: windows-2025
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Test the import check
shell: pwsh
run: ./build/windows/check-compiler-imports-tests.ps1
- name: Install dependencies
shell: pwsh
timeout-minutes: 10
# flex and bison are not on the runner image. Pinned to the version the
# MSVC container in build/docker/msvc uses.
run: choco install winflexbison3 --version=2.5.24.20210105 -y --no-progress
- name: Generate build files using CMake
shell: pwsh
timeout-minutes: 10
run: |
# No -DWITH_MT here: the released compiler links the shared runtime,
# and so does this build. See THRIFT-6320.
cmake -S . -B cmake_build -DBUILD_LIBRARIES=OFF | Tee-Object -Variable configureLog
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# Without this the job would happily build and test nothing at all.
if (-not ($configureLog -match 'Build compiler:\s+ON')) {
Write-Error 'CMake did not configure a compiler build.'
exit 1
}
- name: Run build
timeout-minutes: 30
run: cmake --build cmake_build --config Release
- name: Run test
timeout-minutes: 30
run: ctest --test-dir cmake_build -C Release --no-tests=error --output-on-failure
- name: Run install
run: cmake --install cmake_build --config Release --prefix cmake_install
- name: Run thrift version
run: ./cmake_install/bin/thrift.exe -version
- name: Check what the compiler imports
shell: pwsh
run: ./build/windows/check-compiler-imports.ps1 -Path cmake_install/bin/thrift.exe
- name: Archive built thrift compiler (Windows)
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: thrift-compiler-windows
path: cmake_install/bin/thrift.exe
retention-days: 3
- name: Upload LastTest log
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cmake-windows-LastTest-log
path: cmake_build/Testing/Temporary/LastTest.log
if-no-files-found: warn