-
-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (67 loc) · 2.13 KB
/
ci.yml
File metadata and controls
79 lines (67 loc) · 2.13 KB
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
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-latest, macos-latest, windows-latest]
build_type: [Debug, Release]
include:
- os: ubuntu-22.04
compiler: gcc
- os: ubuntu-latest
compiler: gcc
- os: macos-latest
compiler: clang
- os: windows-latest
compiler: msvc
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build
sudo apt-get install -y iproute2 iptables net-tools dnsutils
sudo apt-get install -y libjsoncpp-dev libgtest-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install cmake ninja
git clone https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install jsoncpp
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
choco install cmake ninja
vcpkg install jsoncpp gtest
- name: Configure CMake
if: runner.os != 'macOS'
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Configure CMake (macOS)
if: runner.os == 'macOS'
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
- name: Test
working-directory: build
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: netmgr-${{ matrix.os }}-${{ matrix.build_type }}
path: |
build/netmgr*
!build/**/*.o
!build/**/*.obj