-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (113 loc) · 3.56 KB
/
ci-test.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
name: GitHub-CI for ci-test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
fail-fast: false # don't abort other jobs if a job fails
matrix:
config:
- {
name: "Ubuntu Linux (gcc)",
os: ubuntu-latest,
arch: amd64,
shell: bash,
#cmake_generator: "Unix Makefiles",
cmake_generator: "Ninja",
cc: gcc,
cxx: g++
}
- {
name: "Ubuntu Linux (clang)",
os: ubuntu-latest,
arch: arm64,
shell: bash,
#cmake_generator: "Unix Makefiles",
cmake_generator: "Ninja",
cc: clang,
cxx: clang++
}
- {
name: "macOS (clang)",
os: macos-latest,
shell: bash,
cmake_generator: "Unix Makefiles",
cc: clang,
cxx: clang++
}
- {
name: "Windows 64-bit (gcc)",
os: windows-latest,
shell: 'msys2 {0}',
#cmake_generator: "MSYS Makefiles",
cmake_generator: "Ninja",
msystem: MINGW64,
arch: x86_64,
cc: x86_64-w64-mingw32-gcc.exe,
cxx: x86_64-w64-mingw32-g++.exe
}
- {
name: "Windows 32-bit (gcc)",
os: windows-latest,
shell: 'msys2 {0}',
#cmake_generator: "MSYS Makefiles",
cmake_generator: "Ninja",
msystem: MINGW32,
arch: i686,
cc: i686-w64-mingw32-gcc.exe,
cxx: i686-w64-mingw32-g++.exe
}
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
steps:
- if: matrix.config.os == 'ubuntu-latest'
name: Install build dependencies (Linux)
run: |
sudo apt-get install cmake ninja-build
- if: matrix.config.os == 'macos-latest'
name: Install build dependencies (macOS)
run: |
brew install ninja
- if: matrix.config.os == 'windows-latest'
name: Install build dependencies (Windows)
uses: msys2/setup-msys2@v2
with:
update: false
msystem: ${{ matrix.config.msystem }}
install: >-
git
mingw-w64-${{ matrix.config.arch }}-cmake
mingw-w64-${{ matrix.config.arch }}-ninja
mingw-w64-${{ matrix.config.arch }}-toolchain
- uses: actions/checkout@v1
- name: Configure (cmake)
run: |
cmake -G"${{ matrix.config.cmake_generator }}" \
-DCMAKE_C_COMPILER=${{ matrix.config.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-DCMAKE_INSTALL_PREFIX:PATH=../build_result \
-DBUILD_STATIC:BOOL=ON \
-DBUILD_SHARED:BOOL=ON \
-DBUILD_UTILS:BOOL=ON \
-DBUILD_DOCUMENTATION:BOOL=OFF \
-S. -Bbuild_temp
- if: matrix.config.cmake_generator != 'Ninja'
name: Build (make)
run: |
make -Cbuild_temp install/strip
- if: matrix.config.cmake_generator == 'Ninja'
name: Build (ninja)
run: |
ninja -Cbuild_temp install/strip
- name: Test
run: |
LD_LIBRARY_PATH=$PWD/build_result/lib:$LD_LIBRARY_PATH DYLD_LIBRARY_PATH=$PWD/build_result/lib:$DYLD_LIBRARY_PATH build_result/bin/myapplication