Skip to content

Commit 4673507

Browse files
committed
github: ci: fix cmake dependency
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
1 parent 5e59cbc commit 4673507

1 file changed

Lines changed: 54 additions & 12 deletions

File tree

.github/workflows/build.yaml

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,30 @@ jobs:
3434
name: CentOS 7 build to confirm no issues once used downstream
3535
runs-on: ubuntu-latest
3636
container: centos:7
37+
env:
38+
# workaround required for checkout@v3, https://github.com/actions/checkout/issues/1590
39+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
3740
permissions:
3841
contents: none
3942
steps:
4043
- name: Set up base image dependencies
4144
run: |
4245
sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
4346
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
44-
yum -y update && \
45-
yum install -y ca-certificates cmake curl-devel gcc gcc-c++ git make wget && \
47+
yum -y update
48+
yum install -y ca-certificates curl-devel gcc gcc-c++ git make wget
4649
yum install -y epel-release
47-
yum install -y cmake3
4850
shell: bash
4951

52+
- name: Install CMake 3.20.0
53+
run: |
54+
CMAKE_VERSION=3.20.0
55+
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh
56+
chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh
57+
./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --prefix=/usr/local
58+
ln -sf /usr/local/bin/cmake /usr/bin/cmake
59+
cmake --version
60+
5061
- name: Clone repo without submodules (1.8.3 version of Git)
5162
run: |
5263
git clone https://github.com/fluent/cprofiles.git
@@ -69,7 +80,7 @@ jobs:
6980

7081
- name: Run compilation
7182
run: |
72-
cmake3 -DCPROF_DEV=on ../
83+
cmake -DCPROF_DEV=on ../
7384
make
7485
shell: bash
7586
working-directory: cprofiles/build
@@ -81,10 +92,22 @@ jobs:
8192
steps:
8293
- name: Set up base image dependencies
8394
run: |
95+
sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list
96+
sed -i 's/security.debian.org/archive.debian.org/g' /etc/apt/sources.list
8497
apt-get update
85-
apt-get install -y build-essential cmake make git
98+
apt-get install -y build-essential git make wget
8699
shell: bash
87100

101+
- name: Install CMake 3.20.0
102+
run: |
103+
CMAKE_VERSION=3.20.0
104+
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh
105+
chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh
106+
./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --prefix=/usr/local
107+
echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bashrc
108+
export PATH="/usr/local/bin:$PATH"
109+
/usr/local/bin/cmake --version
110+
88111
- uses: actions/checkout@v6
89112
with:
90113
submodules: true
@@ -116,7 +139,7 @@ jobs:
116139
uses: uraimo/run-on-arch-action@v3.0.1
117140
with:
118141
arch: aarch64
119-
distro: ubuntu20.04
142+
distro: ubuntu_latest
120143
run: |
121144
apt-get update && \
122145
apt-get install -y --no-install-recommends \
@@ -178,12 +201,31 @@ jobs:
178201
with:
179202
submodules: true
180203

181-
- uses: docker://lpenz/ghaction-cmake:0.19
182-
with:
183-
preset: ${{ matrix.preset }}
184-
# dependencies_debian: ''
185-
cmakeflags: '-DCPROF_TESTS=On -DCPROF_DEV=on .'
186-
build_command: make all
204+
- name: Install dependencies
205+
run: |
206+
sudo apt-get update
207+
sudo apt-get install -y \
208+
clang \
209+
git \
210+
gcc \
211+
g++ \
212+
make \
213+
valgrind \
214+
wget
215+
216+
- name: Install CMake 3.20.0
217+
run: |
218+
CMAKE_VERSION=3.20.0
219+
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh
220+
chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh
221+
sudo ./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --prefix=/usr/local
222+
sudo ln -sf /usr/local/bin/cmake /usr/bin/cmake
223+
/usr/local/bin/cmake --version
224+
225+
- name: Configure and build
226+
run: |
227+
/usr/local/bin/cmake -DCPROF_TESTS=On -DCPROF_DEV=on .
228+
make all
187229
188230
# this job provides the single required status for PRs to be merged into main.
189231
# instead of updating the protected branch status in github, developers can update the needs section below

0 commit comments

Comments
 (0)