forked from hpcc-systems/HPCC-Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (177 loc) · 7.6 KB
/
build-docker.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
name: Build Package (Docker)
on:
workflow_call:
inputs:
os:
type: string
description: 'Operating System'
required: false
default: 'ubuntu-22.04'
ln:
type: boolean
description: 'Internal Build'
required: false
default: false
single-package:
type: boolean
description: 'Single Package'
required: false
default: true
build-type:
type: string
description: 'CMake Build Type'
required: false
default: 'RelWithDebInfo'
containerized:
type: boolean
description: 'Containerized Build'
required: false
default: false
strip-files:
type: boolean
description: 'Strip Debug Symbols'
required: false
default: true
cmake-configuration:
type: string
description: 'CMake Configuration'
required: false
default: '-DVCPKG_FILES_DIR=/hpcc-dev -DCPACK_THREADS=0 -DUSE_OPTIONAL=OFF -DUSE_CPPUNIT=ON -DSUPPRESS_V8EMBED=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache'
cmake-configuration-ex:
type: string
description: 'CMake Configuration Extra'
required: false
default: ''
update-cache:
type: boolean
description: 'Update Cache'
required: false
default: true
upload-package:
type: boolean
description: 'Upload Package as Asset'
required: false
default: false
asset-name:
type: string
description: 'Asset Name (if upload-package is true)'
required: false
default: 'build-docker-package'
secrets:
LNB_TOKEN:
required: false
jobs:
build-docker:
runs-on: ubuntu-22.04
steps:
- name: Free additional disk space (remove Android SDK + Tools)
continue-on-error: true
run: |
df -h
sudo rm -rf ${ANDROID_HOME}
sudo rm -rf ${JAVA_HOME_8_X64}
sudo rm -rf ${JAVA_HOME_11_X64}
sudo rm -rf ${JAVA_HOME_17_X64}
sudo rm -rf ${JAVA_HOME_21_X64}
sudo rm -rf ${CHROMEWEBDRIVER}
sudo rm -rf ${EDGEWEBDRIVER}
sudo rm -rf ${GECKOWEBDRIVER}
sudo rm -rf ${SELENIUM_JAR_PATH}
- name: Display disk space (post free)
run: |
df -h
- name: Checkout HPCC-Platform
uses: actions/checkout@v4
with:
submodules: recursive
path: ${{ github.workspace }}/HPCC-Platform
- name: Checkout LN
if: ${{ inputs.ln == true }}
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/LN
token: ${{ secrets.LNB_TOKEN }}
ref: ${{ github.base_ref }}
submodules: recursive
path: ${{ github.workspace }}/LN
- name: Calculate vars
id: vars
working-directory: ${{ github.workspace }}/HPCC-Platform/vcpkg
shell: "bash"
run: |
branch_label_1=${{ github.base_ref }}
branch_label_2=$(echo ${{ github.ref }} | cut -d'/' -f3)
echo "branch_label=${branch_label_1:-$branch_label_2}" >> $GITHUB_OUTPUT
vcpkg_sha_short=$(git rev-parse --short=8 HEAD)
echo "vcpkg_sha_short=$vcpkg_sha_short" >> $GITHUB_OUTPUT
docker_build_label=hpccsystems/platform-build-base-${{ inputs.os }}
echo "docker_tag=$docker_build_label:$vcpkg_sha_short" >> $GITHUB_OUTPUT
- name: Print vars
shell: "bash"
run: |
echo "${{ toJSON(steps.vars.outputs) }}"
- uses: docker/setup-buildx-action@v2
- name: Pull Build Image
run: |
docker pull ${{ steps.vars.outputs.docker_tag }} || true
- uses: hendrikmuhs/[email protected]
with:
save: ${{ inputs.update-cache == true }}
key: docker-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}-${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }}
restore-keys: |
docker-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}-
docker-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-
docker-${{ inputs.os }}-${{ inputs.build-type }}-
docker-${{ inputs.os }}-
- name: CMake Configure and Build
shell: "bash"
run: |
mkdir -p ${{ github.workspace }}/LN
mkdir -p ${{ github.workspace }}/build
mkdir -p ${{ github.workspace }}/.ccache
declare -a plugins
plugins=(${{ inputs.single-package == true && '"PLATFORM"' || '"PLATFORM" "CASSANDRAEMBED" "COUCHBASEEMBED" "ECLBLAS" "H3" "JAVAEMBED" "KAFKA" "MEMCACHED" "MONGODBEMBED" "MYSQLEMBED" "NLP" "PARQUETEMBED" "REDIS" "REMBED" "SQLITE3EMBED" "SQS" "WASMEMBED"' }})
for plugin in "${plugins[@]}"; do
sudo rm -f ${{ github.workspace }}/build/CMakeCache.txt
sudo rm -rf ${{ github.workspace }}/build/CMakeFiles
docker run --rm \
--mount source="${{ github.workspace }}/HPCC-Platform",target=/hpcc-dev/HPCC-Platform,type=bind,consistency=delegated \
--mount source="${{ github.workspace }}/LN",target=/hpcc-dev/LN,type=bind,consistency=delegated \
--mount source="${{ github.workspace }}/build",target=/hpcc-dev/build,type=bind,consistency=delegated \
--mount source="${{ github.workspace }}/.ccache",target=/root/.ccache,type=bind,consistency=delegated \
${{ steps.vars.outputs.docker_tag }} "\
cmake -G Ninja -S /hpcc-dev/${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }} -B /hpcc-dev/build -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} -DCONTAINERIZED=${{ inputs.containerized == true && 'ON' || 'OFF' }} -DCPACK_STRIP_FILES=${{ inputs.strip-files == true && 'ON' || 'OFF' }} ${{ inputs.single-package == true && '-DINCLUDE_PLUGINS=ON' || '-D$plugin=ON' }} ${{ inputs.cmake-configuration }} ${{ inputs.cmake-configuration-ex }} && \
cmake --build /hpcc-dev/build --parallel ${{ inputs.upload-package == true && '--target package' || ''}}"
done
- name: Upload Package
if: ${{ inputs.upload-package == true }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.asset-name }}
path: |
${{ github.workspace }}/build/*.deb
${{ github.workspace }}/build/*.rpm
if-no-files-found: error
- name: Upload Support Files
if: ${{ inputs.upload-package == true }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.asset-name }}-support-files
path: |
${{ github.workspace }}/HPCC-Platform/.github/workflows/smoketest-preabort.sh
${{ github.workspace }}/HPCC-Platform/.github/workflows/timeoutcmd
if-no-files-found: error
- name: Upload ECL Watch UI Test Files
if: ${{ inputs.upload-package == true }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.asset-name }}-ecl_watch_ui_tests
path: |
${{ github.workspace }}/HPCC-Platform/esp/src/test-ui/tests/**/*
if-no-files-found: error
- name: Upload Error Logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.os }}-${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }}-logs
path: ${{ github.workspace }}/build/**/*.log