Skip to content

Commit 9a258cb

Browse files
Merge pull request #1 from L-Acoustics/ci/linux_job_update_260225
Github action linux job
2 parents 083496a + 1f40073 commit 9a258cb

3 files changed

Lines changed: 69 additions & 5 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: CMake
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
4+
workflow_dispatch:
85

96
env:
107
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)

.github/workflows/linux.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Linux
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ dev ]
8+
paths-ignore:
9+
- 'Docker'
10+
- '**/README.md'
11+
- '**/LICENCE'
12+
13+
jobs:
14+
linux-build-and-test:
15+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
16+
# You can convert this to a matrix build if you need cross-platform coverage.
17+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
target: ["release","debug"]
22+
os: ["ubuntu-22.04","ubuntu-22.04-arm"]
23+
24+
runs-on: ${{matrix.os}}
25+
steps:
26+
- uses: actions/checkout@v2
27+
with:
28+
submodules: recursive
29+
30+
- name: Install job dependencies
31+
run : |
32+
sudo apt-get update
33+
sudo apt-get install -y ninja-build wget build-essential
34+
35+
- name: Install CMake 3.31.5
36+
shell: bash
37+
run: |
38+
set +xe
39+
which cmake &> /dev/null
40+
if [ $? -ne 0 ]; then
41+
arch=$([ $(uname -m) = "arm64" ] && echo "aarch64" || echo "x86_64")
42+
cmake_script="cmake-3.31.5-linux-$arch.sh"
43+
wget "https://github.com/Kitware/CMake/releases/download/v3.31.5/$cmake_script"
44+
chmod +x $cmake_script
45+
sudo ./$cmake_script --skip-license --prefix=/usr/local
46+
fi
47+
CMAKE_VERSION=$(cmake --version | awk '/version/ {print $3}')
48+
echo "Using cmake: ${CMAKE_VERSION}"
49+
- name: Configure CMake
50+
shell: bash
51+
run: |
52+
echo "Generating CMake for Target: ${{matrix.target}}"
53+
./gen_cmake.sh -o _build -${{matrix.target}} -c Ninja
54+
55+
- name: Build
56+
# Build your program with the given configuration
57+
run: cmake --build _build
58+
59+
- name: Test
60+
working-directory: ${{github.workspace}}/_build/tests/src
61+
shell: bash
62+
run: |
63+
test_cmd="./Tests --gtest_filter=-MANUAL*"
64+
if [ "${{matrix.target}}" = "debug" ]; then
65+
test_cmd="./Tests-d --gtest_filter=-MANUAL*"
66+
fi
67+
eval $test_cmd

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
[![Linux build & test](https://github.com/L-Acoustics/networkInterfaceHelper/actions/workflows/linux.yml/badge.svg)](https://github.com/L-Acoustics/networkInterfaceHelper/actions/workflows/linux.yml)
12
# LA Network Interface Helper Library
23

34
Copyright (C) 2016-2023, L-Acoustics
4-
55
## What is LA_networkInterfaceHelper
66
LA_networkInterfaceHelper is a lightweight open source library for enumerating Network Interfaces and monitoring any state change.
77

0 commit comments

Comments
 (0)