-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use openziti-tunnel-build-action to run cmake builds for linux
- Loading branch information
1 parent
090ac9e
commit 40ae1cd
Showing
4 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,16 +43,25 @@ runs: | |
path: './vcpkg/packages' | ||
|
||
- uses: lukka/[email protected] # pin version to avoid failed glibc dependency on ubuntu 20 runners. go back to @latest when ubuntu 22+ is adopted for runner os. | ||
if: runner.os != 'ubuntu' | ||
name: Configure CMake | ||
with: | ||
configurePreset: ci-${{ inputs.preset }} | ||
configurePresetAdditionalArgs: "[ `-B`, `./build` ]" | ||
|
||
- name: build ziti-edge-tunnel | ||
- name: build ziti-edge-tunnel (non-linux) | ||
if: runner.os != 'ubuntu' | ||
shell: bash | ||
run: | | ||
cmake \ | ||
--build ./build \ | ||
--config ${{ inputs.config }} \ | ||
--target ${{ inputs.target }} \ | ||
--verbose | ||
- name: build ziti-edge-tunnel (linux) | ||
if: runner.os == 'ubuntu' | ||
uses: ./.github/actions/openziti-tunnel-build-action | ||
with: | ||
arch: ${{ inputs.preset }} | ||
config: ${{ inputs.config }} |
8 changes: 8 additions & 0 deletions
8
.github/actions/openziti-tunnel-build-action/gh-release/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ARG CMAKE_VERSION="3.26.3" | ||
ARG VCPKG_VERSION="master" | ||
|
||
# use ziti-builder:v1 (basded on ubuntu focal) for older glibc (2.27) | ||
FROM openziti/ziti-builder:v1 | ||
|
||
COPY ./entrypoint.sh /root/ | ||
ENTRYPOINT [ "/root/entrypoint.sh" ] |
74 changes: 74 additions & 0 deletions
74
.github/actions/openziti-tunnel-build-action/gh-release/entrypoint.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright 2024 NetFoundry Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# | ||
# RedHat 8 | ||
# | ||
|
||
set -euo pipefail | ||
|
||
# these commands must be in the entrypoint so they are run after workspace is mounted on Docker workdir | ||
echo "INFO: GIT_DISCOVERY_ACROSS_FILESYSTEM=${GIT_DISCOVERY_ACROSS_FILESYSTEM}" | ||
echo "INFO: WORKDIR=${PWD}" | ||
echo "INFO: $(git --version)" | ||
|
||
# if first positional is an expected arch string then set cmake preset, | ||
# else use ci-linux-x64 (which actually just uses native/host tools - e.g. not cross compile) | ||
if [ ${#} -ge 1 ]; then | ||
cmake_preset="${1}" | ||
else | ||
cmake_preset="ci-linux-x64" | ||
fi | ||
|
||
if [ ${#} -ge 2 ]; then | ||
cmake_config="${2}" | ||
else | ||
cmake_config="RelWithDebInfo" | ||
fi | ||
|
||
# workspace dir for each build env is added to "safe" dirs in global config e.g. | ||
# ~/.gitconfig so both runner and builder containers trust these dirs | ||
# owned by different UIDs from that of Git's EUID. This is made necessary | ||
# by newly-enforced directory boundaries in Git v2.35.2 | ||
# ref: https://lore.kernel.org/git/[email protected]/ | ||
for SAFE in \ | ||
/github/workspace \ | ||
/__w/ziti-tunnel-sdk-c/ziti-tunnel-sdk-c \ | ||
/mnt ; do | ||
git config --global --add safe.directory ${SAFE} | ||
done | ||
|
||
cmake -E make_directory ./build | ||
( | ||
[[ -d ./build ]] && rm -r ./build | ||
cmake -E make_directory ./build | ||
# allow unset for scl_source scripts | ||
set +u | ||
source scl_source enable gcc-toolset-10 \ | ||
&& cmake \ | ||
--preset "${cmake_preset}" \ | ||
-DCMAKE_BUILD_TYPE="${cmake_config}" \ | ||
-DBUILD_DIST_PACKAGES=ON \ | ||
-S . \ | ||
-B ./build | ||
source scl_source enable gcc-toolset-10 \ | ||
&& cmake \ | ||
--build ./build \ | ||
--config "${cmake_config}" \ | ||
--target package \ | ||
--verbose | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters