From 4fa5c5c448aef14a7fb3d0badf076b3fffbcb368 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Tue, 8 Apr 2025 07:46:42 -0600 Subject: [PATCH] workflows: updates workflows for CMake 3.20 Signed-off-by: Eduardo Silva --- .github/workflows/build.yaml | 98 ++++++++++++++++++++++++++++-------- 1 file changed, 77 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3fddff5..6d2faee 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -34,22 +34,33 @@ jobs: name: CentOS 7 build to confirm no issues once used downstream runs-on: ubuntu-latest container: centos:7 - permissions: - contents: none + env: + # workaround required for checkout@v3, https://github.com/actions/checkout/issues/1590 + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: - name: Set up base image dependencies run: | sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo - yum -y update && \ - yum install -y ca-certificates cmake curl-devel gcc gcc-c++ git make wget && \ + yum -y update + yum install -y ca-certificates gcc gcc-c++ git make wget yum install -y epel-release - yum install -y cmake3 + yum install -y libcurl-devel + shell: bash - - name: Clone repo with submodules (1.8.3 version of Git) + - name: Install CMake 3.20.0 + run: | + CMAKE_VERSION=3.20.0 + wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh + chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh + ./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --prefix=/usr/local + ln -sf /usr/local/bin/cmake /usr/bin/cmake + cmake --version + + - name: Clone repo without submodules (1.8.3 version of Git) run: | - git clone --recursive https://github.com/calyptia/ctraces.git + git clone https://github.com/fluent/ctraces.git shell: bash - name: Check out the branch (1.8.3 version of Git) @@ -57,14 +68,14 @@ jobs: BRANCH_NAME: ${{ github.head_ref }} run: | git checkout "$BRANCH_NAME" + git submodule update --init --recursive shell: bash working-directory: ctraces - name: Run compilation run: | - cmake3 -DCTR_TESTS=on -DCTR_DEV=on . + cmake -DCTR_TESTS=on -DCTR_DEV=on . make - shell: bash working-directory: ctraces build-debian: @@ -75,19 +86,40 @@ jobs: - name: Set up base image dependencies run: | apt-get update - apt-get install -y build-essential cmake make git + apt-get install -y build-essential wget make gcc g++ git libcurl4-openssl-dev + + - name: Install CMake 3.20.0 + run: | + CMAKE_VERSION=3.20.0 + wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh + chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh + ./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --prefix=/usr/local + + # Ensure the new CMake is found first + echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bashrc + export PATH="/usr/local/bin:$PATH" + + # Confirm CMake installation + /usr/local/bin/cmake --version + + - name: Clone repository and submodules + run: | + git clone --recursive https://github.com/fluent/ctraces.git shell: bash - - uses: actions/checkout@v4 - with: - submodules: true + - name: Initialize submodules + run: | + git submodule update --init --recursive + shell: bash + working-directory: ctraces - name: Run compilation run: | - cmake -DCTR_TESTS=On . + cmake -DCTR_TESTS=On -DCTR_DEV=On . make all CTEST_OUTPUT_ON_FAILURE=1 make test shell: bash + working-directory: ctraces build-unix-arm64: name: Build sources on arm64 for ${{ matrix.os }} - ${{ matrix.compiler }} @@ -164,16 +196,40 @@ jobs: contents: read runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Check out the repository + uses: actions/checkout@v4 with: submodules: true - - uses: docker://lpenz/ghaction-cmake:0.19 - with: - preset: ${{ matrix.preset }} - # dependencies_debian: '' - cmakeflags: '-DCTR_TESTS=On -DCMT_DEV=on .' - build_command: make all + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + clang \ + valgrind \ + wget \ + make \ + gcc \ + g++ \ + git \ + libcurl4-openssl-dev + + - name: Install CMake 3.20.0 or higher + run: | + CMAKE_VERSION=3.20.0 + wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh + chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh + sudo ./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --prefix=/usr/local + sudo ln -sf /usr/local/bin/cmake /usr/bin/cmake + /usr/local/bin/cmake --version + + - name: Initialize Submodules + run: git submodule update --init --recursive + + - name: Configure and Build + run: | + /usr/local/bin/cmake -DCTR_TESTS=On -DCTR_DEV=On -DCMT_DEV=on . + make all # this job provides the single required status for PRs to be merged into main. # instead of updating the protected branch status in github, developers can update the needs section below