-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (120 loc) · 3.64 KB
/
unix.yml
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
name: Unix
on:
push:
branches:
- main
pull_request:
env:
BUILD_TYPE: Release
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
# Without MLPACK
- {
name: "macOS 11.0 AppleClang [NO MLPACK]",
mlpack: false,
os: macos-11.0,
cxx: "clang++",
c: "clang"
}
- {
name: "macOS 11.0 GCC 11 [NO MLPACK]",
mlpack: false,
os: macos-11.0,
cxx: "g++-11",
c: "gcc-11"
}
- {
name: "Ubuntu 22.04 Clang 11 [NO MLPACK]",
mlpack: false,
os: ubuntu-22.04,
cxx: "clang++-11",
c: "clang-11"
}
- {
name: "Ubuntu 22.04 GCC 11 [NO MLPACK]",
mlpack: false,
os: ubuntu-22.04,
cxx: "g++-11",
c: "gcc-11"
}
# With MLPACK
# - {
# name: "macOS 11.0 AppleClang [MLPACK]",
# mlpack: true,
# os: macos-11.0,
# cxx: "clang++",
# c: "clang"
# }
# - {
# name: "macOS 11.0 GCC 11 [MLPACK]",
# mlpack: true,
# os: macos-11.0,
# cxx: "g++-11",
# c: "gcc-11"
# }
- {
name: "Ubuntu 22.04 Clang 11 [MLPACK]",
mlpack: true,
os: ubuntu-22.04,
cxx: "clang++-11",
c: "clang-11"
}
- {
name: "Ubuntu 22.04 GCC 11 [MLPACK]",
mlpack: true,
os: ubuntu-22.04,
cxx: "g++-11",
c: "gcc-11"
}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Get macOS Concurrency
if: runner.os == 'macOS'
run: |
echo NPROC="sysctl -n hw.ncpu" >> $GITHUB_ENV
echo "Running on $(sysctl -n hw.ncpu) threads ..."
- name: Get Linux Concurrency
if: runner.os == 'Linux'
run: |
echo NPROC="nproc" >> $GITHUB_ENV
echo "Running on $(nproc) threads ..."
- name: Set Up macOS Dependencies
if: runner.os == 'macOS'
run: |
brew install gcc@11 python3
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig
sudo easy_install pip
sudo pip3 install --upgrade pip
sudo pip3 install pytest numpy
- name: Set Up Linux Dependencies
if: runner.os == 'Linux'
run: |
sudo apt update && sudo apt upgrade -y && sudo apt install -y cmake pkg-config clang-11 g++-11 python3-pip python3-dev
sudo pip3 install pytest numpy
- name: Set Up macOS MLPACK
if: runner.os == 'macOS' && matrix.config.mlpack
run: |
brew install mlpack
- name: Set Up Linux MLPACK
if: runner.os == 'Linux' && matrix.config.mlpack
run: |
sudo apt install -y libmlpack-dev mlpack-bin libensmallen-dev
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=${{matrix.config.cxx}} -DCMAKE_C_COMPILER=${{matrix.config.c}} -DENABLE_MLPACK=${{matrix.config.mlpack}} -DBUILD_PYTHON=ON
- name: Build All
working-directory: ${{runner.workspace}}/build
run: cmake --build . --parallel $($NPROC)
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -j $($NPROC)