-
Notifications
You must be signed in to change notification settings - Fork 397
62 lines (52 loc) · 1.53 KB
/
Copy pathci.yml
File metadata and controls
62 lines (52 loc) · 1.53 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
name: CI
on:
push:
branches:
- alpha
- beta
- master
pull_request:
workflow_dispatch:
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-latest]
compiler: [gcc, clang]
exclude:
# macOS doesn't have gcc in GitHub Actions (it's aliased to clang)
- os: macos-latest
compiler: gcc
name: ${{ matrix.os }} - ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive # if googletest is a submodule
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential
- name: Set compiler (GCC)
if: matrix.compiler == 'gcc'
run: |
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
- name: Set compiler (Clang)
if: matrix.compiler == 'clang'
run: |
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DFANN_BUILD_TESTS=ON
- name: Build
run: cmake --build build --config Release -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)
- name: Run tests
working-directory: build
run: ./tests/fann_tests