-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (152 loc) · 5.04 KB
/
Copy pathci.yml
File metadata and controls
173 lines (152 loc) · 5.04 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Secure LSL CI
on:
push:
branches: ['*']
tags: ['*']
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
- 'CITATION.cff'
- '.zenodo.json'
pull_request:
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
- 'CITATION.cff'
- '.zenodo.json'
workflow_dispatch:
inputs:
cmake_extra:
description: 'Extra CMake options'
required: false
default: ''
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "macOS-latest"
os: "macos-latest"
install_deps: "brew install libsodium"
cmake_extra: "-DLSL_BUILD_EXAMPLES=ON"
- name: "ubuntu-24.04"
os: "ubuntu-24.04"
install_deps: "sudo apt-get update && sudo apt-get install -y libsodium-dev libpugixml-dev"
cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF -DLSL_BUILD_EXAMPLES=ON"
- name: "ubuntu-22.04"
os: "ubuntu-22.04"
install_deps: "sudo apt-get update && sudo apt-get install -y libsodium-dev libpugixml-dev"
cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF -DLSL_BUILD_EXAMPLES=ON"
- name: "windows-latest"
os: "windows-latest"
install_deps: "vcpkg install libsodium:x64-windows"
cmake_extra: "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DLSL_BUILD_EXAMPLES=OFF"
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ${{ matrix.config.install_deps }}
- name: Configure CMake
working-directory: liblsl
run: |
cmake --version
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PWD}/install \
-DLSL_SECURITY=ON \
-DLSL_SECURITY_TOOLS=ON \
-DLSL_UNITTESTS=ON \
-DCPACK_PACKAGE_DIRECTORY=${PWD}/package \
-Dlslgitrevision=${{ github.sha }} \
-Dlslgitbranch=${{ github.ref }} \
${{ matrix.config.cmake_extra }} \
${{ github.event.inputs.cmake_extra }}
- name: Build
working-directory: liblsl
run: cmake --build build --target install --config Release -j
- name: Print network config
run: |
if command -v ifconfig &> /dev/null; then ifconfig; fi
if command -v ip &> /dev/null; then
ip link
ip addr
fi
if: runner.os != 'Windows'
- name: Run security tests
working-directory: liblsl
run: install/bin/lsl_test_internal "[security]" --order rand --wait-for-keypress never --durations yes
timeout-minutes: 5
- name: Run internal tests
working-directory: liblsl
run: install/bin/lsl_test_internal --order rand --wait-for-keypress never --durations yes
timeout-minutes: 5
if: ${{ success() || failure() }}
- name: Run exported tests
working-directory: liblsl
run: install/bin/lsl_test_exported --order rand --wait-for-keypress never --durations yes
timeout-minutes: 5
if: ${{ success() || failure() }}
- name: Test security tools (Unix)
if: runner.os != 'Windows'
working-directory: liblsl
env:
LSLAPICFG: /tmp/test_lsl_api.cfg
run: |
echo "Testing lsl-keygen..."
install/bin/lsl-keygen --help
# Use --insecure for CI (no TTY for passphrase prompt)
install/bin/lsl-keygen --force --insecure
echo "Testing lsl-config..."
install/bin/lsl-config --check
install/bin/lsl-config --show-public
- name: Test security tools (Windows)
if: runner.os == 'Windows'
working-directory: liblsl
env:
LSLAPICFG: ${{ runner.temp }}\test_lsl_api.cfg
run: |
echo "Testing lsl-keygen..."
install/bin/lsl-keygen.exe --help
install/bin/lsl-keygen.exe --force --insecure
echo "Testing lsl-config..."
install/bin/lsl-config.exe --check
install/bin/lsl-config.exe --show-public
- name: Upload install artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.config.name }}
path: liblsl/install
- name: Package
working-directory: liblsl
run: |
cmake --build build --target package --config Release -j
cmake -E remove_directory package/_CPack_Packages || true
- name: Upload package artifacts
uses: actions/upload-artifact@v4
with:
name: pkg-${{ matrix.config.name }}
path: liblsl/package
docs:
name: "Build Documentation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Doxygen
run: sudo apt-get update && sudo apt-get install -y doxygen
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install docs dependencies
run: pip install -r docs/requirements.txt
- name: Build documentation
run: mkdocs build --strict